v2.0.0
What's Changed
2.0.0 (2021-10-16)
⚠ BREAKING CHANGES
- For TypeScript users only, if you were previously using
from
orfromAsync
and you expected the error result to be of typeError
, it will now beunknown
. You can reset this back toError
by providing it as the second generic type argument. - command: For TypeScript users please rename your
Command#run
methods toCommand#messageRun
Awaited
type has been renamed toAwaitable
- Updated
@sapphire/pieces
to3.0.0
- Removed
Command#categories
, useCommandStore#categories
instead - arguments: Changed the error message of DateArgument
- arguments: Changed the error message of FloatArgument
- arguments: Changed the error message of NumberArgument
- arguments: Changed the error message of IntegerArgument
- arguments: Changed the error message of all arguments that must be run in a guild
- arguments: Changed the error message of GuildNewsThreadChannelArgument
- arguments: Changed the error message of GuildPrivateThreadChannelArgument
- arguments: Changed the error message of GuildPublicThreadChannelArgument
- arguments: Changed the error message of GuildStageVoiceChannelArgument
- arguments: Changed the error message of GuildTextChannelArgument
- arguments: Changed the error message of GuildThreadChannelArgument
- arguments: Changed the error message of GuildVoiceChannelArgument
- arguments: Changed the error message of GuildMemberArgument
- arguments: Changed the error message of UserArgument
- arguments: Made MessageArgumentContext private
- arguments: Stop exposing the channel property in context of the ChannelArgument error
- arguments: Stop exposing the channel property in context of the GuildCategoryChannelArgument error
- arguments: Stop exposing the channel property in context of the GuildNewsChannelArgument error
- arguments: Stop exposing the channel property in context of the GuildPrivateThreadArgument error
- arguments: Stop exposing the channel property in context of the GuildStageVoiceChannelArgument error
- arguments: Stop exposing the channel property in context of the GuildTextChannelArgument error
- arguments: Stop exposing the channel property in context of the GuildThreadChannelArgument error
- arguments: Stop exposing the channel property in context of the GuildVoiceChannelArgument error
- arguments: Rename Identifiers.ArgumentBoolean to Identifiers.ArgumentBooleanError
- arguments: Rename Identifiers.ArgumentCategoryChannel to Identifiers.ArgumentGuildCategoryChannelError
- arguments: Rename Identifiers.ArgumentChannel to Identifiers.ArgumentChannelError
- arguments: Rename Identifiers.ArgumentDate to Identifiers.ArgumentDateError
- arguments: Rename Identifiers.ArgumentDateTooSmall to Identifiers.ArgumentDateTooEarly
- arguments: Rename Identifiers.ArgumentDateTooBig to Identifiers.ArgumentDateTooFar
- arguments: Rename Identifiers.ArgumentDMChannel to Identifiers.ArgumentDMChannelError
- arguments: Rename Identifiers.ArgumentFloat to Identifiers.ArgumentFloatError
- arguments: Rename Identifiers.ArgumentFloatTooBig to Identifiers.ArgumentFloatTooLarge
- arguments: Rename Identifiers.ArgumentGuildChannel to Identifiers.ArgumentGuildChannelError
- arguments: Rename Identifiers.ArgumentGuildChannelMissingGuild to Identifiers.ArgumentGuildChannelMissingGuildError
- arguments: Rename Identifiers.ArgumentHyperlink to Identifiers.ArgumentHyperlinkError
- arguments: Rename Identifiers.ArgumentInteger to Identifiers.ArgumentIntegerError
- arguments: Rename Identifiers.ArgumentIntegerTooBig to Identifiers.ArgumentIntegerTooLarge
- arguments: Rename Identifiers.ArgumentMember to Identifiers.ArgumentMemberError
- arguments: Rename Identifiers.ArgumentMessage to Identifiers.ArgumentMessageError
- arguments: Rename Identifiers.ArgumentNewsChannel to Identifiers.ArgumentGuildNewsChannelError
- arguments: Rename Identifiers.ArgumentNumber to Identifiers.ArgumentNumberError
- arguments: Rename Identifiers.ArgumentNumberTooBig to Identifiers.ArgumentNumberTooLarge
- arguments: Rename Identifiers.ArgumentRole to Identifiers.ArgumentRoleError
- arguments: Rename Identifiers.ArgumentTextChannel to Identifiers.ArgumentGuildTextChannel
- arguments: Rename Identifiers.ArgumentUser to Identifiers.ArgumentUserError
- arguments: Rename Identifiers.ArgumentVoiceChannel to Identifiers.ArgumentGuildVoiceChannel
Identifiers.PreconditionPermissions
has been renamed toIdentifiers.PreconditionClientPermissions
- UserError identifier
preconditionPermissions
has been renamed topreconditionClientPermissions
Permissions
precondition has been renamed toClientPermissions
PermissionsPrecondition
class has been renamed toClientPermissionsPrecondition
- listener: Listeners will now be automatically unloaded if no emitter is found
- Changed
guildChannel
argument to returnGuildChannel | ThreadChannel
. - Changed
SapphireClient.id
's type toSnowflake | null
. - Changed
SapphireClientOptions.id
's type toSnowflake | null
. - Removed
Events.GuildMemberSpeaking
. - Removed
StoreRegistry
, it is now re-exported from@sapphire/pieces
. - Renamed
ArgType.categoryChannel
toguildCategoryChannel
. - Renamed
ArgType.newsChannel
toguildNewsChannel
. - Renamed
ArgType.textChannel
toguildTextChannel
. - Renamed
ArgType.voiceChannel
toguildVoiceChannel
. - Renamed
CommandPreConditions.NewsOnly
toGuildNewsOnly
. - Renamed
CommandPreConditions.TextOnly
toGuildTextOnly
. - Renamed
Identifiers.PreconditionNewsOnly
toPreconditionGuildNewsOnly
. - Renamed
Identifiers.PreconditionTextOnly
toPreconditionGuildTextOnly
. - Renamed
Preconditions.NewsOnly
toGuildNewsOnly
. - Renamed
Preconditions.TextOnly
toGuildTextOnly
. - Renamed the possible values for
CommandOptionsRunType
. - Updated
CooldownContext.delay
to not be optional. - Updated
discord.js
requirement to v13. - Changed
Command#preconditions
toPreconditionContainerArray
. - Removed
Command#resolveConstructorPreConditions
. - Renamed
CommandOptions.cooldownBucket
tocooldownLimit
. - Renamed
CommandOptions.cooldownDuration
tocooldownDelay
. - Renamed
BucketType
toBucketScope
. - Changed
PreconditionSingleResolvableDetails
to take a type parameter. - Changed
PreconditionSingleResolvable
to usePreconditions
's type. - Renamed
CooldownContext.bucketType
toscope
. - Renamed
Event
toListener
- Renamed
EventStore
toListenerStore
- Changed events directory from
events
tolisteners
- Renamed
SapphireClientOptions.loadDefaultErrorEvents
toloadDefaultErrorListeners
- Renamed
StoreRegistryEntries.events
toStoreRegistryEntries.listeners
- Refactored
Events
enum to be an object, so we can use discord.js's constants - Renamed
Events.EventError
toEvents.ListenerError
- Renamed
EventErrorPayload
toListenerErrorPayload
- Renamed
Events.Ready
toEvents.ClientReady
- Renamed
Events.Message
toEvents.MessageCreate
- Flattened
CommandOptions.strategyOptions
intoCommandOptions
- Changed
CommandOptions.preconditions
to always require an array - Updated
@sapphire/pieces
to 2.0.0 - Renamed
PieceContextExtras
toContainer
, usage and augmentation is the same. - Removed
Store.injectedContext
, use globally exportedcontainer
variable instead. - Renamed
Store#context
toStore#container
. - Renamed
Piece#context
toPiece#container
.
Features
- add
Result#from
andResult#fromAsync
(#267) (300f2ed) - Add
typing
property to fireTextChannel.sendTyping()
when a command is accepted (#258) (71c1883) - add managed role mention prefix support (#289) (7846d6c)
- add partial dm channel argument (#288) (c8c74de)
- add UserPermissions precondition (#252) (2bb2e12)
- added auto-preconditions (#199) (7e79e15)
- arguments: extract logic to resolvers (#237) (32d591b)
- client: added option to set a default cooldown for all commands (#294) (7734d59)
- command: add
command#messageRun
method and deprecation warning forcommand#run
(#299) (750c25c) - command: add CommandOptionsRunTypeEnum (#254) (2d21b03)
- commands: add category getters (#244) (d438ac0)
- cooldown: add
cooldownFilteredUsers
to exempt users from the cooldown precondition (#249) (8261770) - ILogger: add #has method, auto-register Store#logger (#221) (85bfacb)
- member argument: slice off Discord discriminators before performing a query search (#301) (f6261ae)
- NonePrefixedMessage event (#202) (a410bbf)
- resolver: make resolveChannel parse mentions (#253) (506576e)
- resolver: make resolveMessage parse channelId-messageId (#292) (5e915d0)
- specify missing breaking changes (9097cf5)
- stricter types for preconditions (#226) (4a3c76a)
- update @sapphire/pieces to add
ts-node
support (7a1c5c6) - update to DiscordJS v13.2.0 (#295) (51808a5)
- updated for
pieces
v3 (#260) (db6febd)
Bug Fixes
-
change
Awaited
toAwaitable
(189c01f) -
docs: it was always
info
(3ce4d71) -
explicitly type
version
asstring
(a8c9b39) -
export
CooldownContext
andMessageArgumentContext
(54ba95a) -
fixed ESM bundle (7ca08b2)
-
index: re-export
StoreRegistryEntries
from@sapphire/pieces
(#243) (aa78ba9) -
make from/fromAsync return
unknown
to match TypeScript (#300) (a83f0c9) -
NonePrefixedMessage: rename to NonPrefixedMessage (#205) (ad8adbc)
-
preconditions: fixed UserPermissions precondition (1848f53)
-
preconditions: properly check for
null
in ClientPermissions and UserPermissions (#262) (852ee87) -
remove peer deps, update dev deps, update READMEs (#210) (7cb9e3d)
-
specify missing breaking changes (b9c36de)
-
switch to
sapphire/*[@v2](https://github.com/v2)
anddiscord.js@dev
(#227) (cbf5d4e)
New Contributors
- @PoroUsedSnax made their first contribution in #202
- @kaname-png made their first contribution in #222
- @c43721 made their first contribution in #233
- @bitomic made their first contribution in #258
- @Lioness100 made their first contribution in #267
- @renovate made their first contribution in #272
Full Changelog: v1.0.2...v2.0.0