All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
5.10.0 - 2022-10-17
- Context: Refactored duplicate methods into a single
BaseInteractionContext
(#384) - Server: Deprecated
.use
and.addMiddleware
and madeapp
member public - FastifyServer: Support for v4
- types:
GUILD_FORUM
andGUILD_DIRECTORY
toChannelType
- types: Added
USER_SELECT
,ROLE_SELECT
,MENTIONABLE_SELECT
,CHANNEL_SELECT
and renamedSELECT
toSTRING_SELECT
(#264)
5.9.0 - 2022-09-04
- RequestHandler: Updated API version to v10
- This shouldn't change anything when it comes to interaction-specific requests, but be mindful when making manual API requests
- MessageInteractionContext: Editing attachments (#358, #361)
- RequestHandler: Added ability to send audit log reason in requests
- types: Fixed embed types (#357)
5.8.0 - 2022-08-17
- User: Avatar Decorations
- Note that this isn't even out yet in canary but as an experiment, so this may change later or just get removed in general. This change also had some fixes with it and doesn't break anything, so it's there for whenever it exists since it is an existing prop in user objects.
- types: Fixed option localization types
- SlashCreator: Modal callbacks actually get removed after use
- SlashCreator: Emit
unverifiedRequest
on bad timestamps - MessageInteractionContext: Options should no longer be modified when used in sending messages
5.7.1 - 2022-07-12
- types: Add types for
min_length
andmax_length
5.7.0 - 2022-06-30
- MessageInteractionContext & AutocompleteContext: Added
appPermissions
to all contexts.
5.6.1 - 2022-05-21
- Permissions: fixed type mixing in class functions
5.6.0 - 2022-05-16
- SlashCreator: Added
componentTimeouts
option to enable automatic component timeouts.
- MessageInteractionContext: Component registry is no longer tied to the expiry of the interaction.
- MessageInteractionContext: The component expiration starts at the time of registering, rather than the time of the interaction.
5.5.3 - 2022-04-29
- SlashCommand: Added
forcePermissions
option to be able to use default permissions while letting admins change permissions via Integrations page
5.5.2 - 2022-04-29
- SlashCreator: Fix handling outdated command classes (for slash-up compatibility)
5.5.1 - 2022-04-28
- Permissions: Fixed bitfield depending on class name while resolving
5.5.0 - 2022-04-28
- Command permissions have been deprecated, including these methods/options:
SyncCommandOptions#syncPermissions
SlashCreator#syncCommandPermissions
SlashCommandOptions#permissions
SlashCreatorAPI#bulkUpdateCommandPermissions
- SlashCommandOptions:
#requiredPermissions
now sets member permissions within the command usingdefault_member_permissions
. - SlashCommand:
#commandJSON
is now deprecated in favor of#toCommandJSON
.
- Permissions: New flags:
SEND_MESSAGES_IN_THREADS
,USE_EMBEDDED_ACTIVITIES
,MODERATE_MEMBERS
- ApplicationCommandPermissionType: New type:
CHANNEL = 3
- SlashCommandOptions: Added
#dmPermission
- SlashCreatorAPI: Added
withLocalization
option to#getCommands
- CommandContext: Initial response attachments support
- Permission names in constants being outdated
SlashCommandOptions#requiredPermissions
option checking
5.4.1 - 2022-03-30
- Fixed syncing erroring for old command classes
5.4.0 - 2022-03-30
- ModalInteractionContext: Added
#data
,#message
, and#editParent
(#263) - ModalInteractionContext: Added
#acknowledge
(#262) - SlashCommand: Added command localization (#270)
- Message: Fixed message mentions not being parsed correctly (#271)
5.3.0 - 2022-03-04
- SlashCreator: Added
disableTimeouts
option
- SlashCreator: Fixed deep equal checking when syncing
5.2.1 - 2022-02-10
- Fix types for
ApplicationCommandOptionBase
(#247)
5.2.0 - 2022-02-09
ComponentContext
andCommandContext
now extends off ofModalSendableContext
rather than justMessageInteractionContext
.ModalSendableContext
extends off ofMessageInteractionContext
.
- CommandContext: Attachment options (#217)
- SlashCreator:
rawRequest
event (#245) - Modal Interactions (#244)
5.1.0 - 2022-02-04
- MessageInteractionContext: User locale and guild locale (#216)
- SlashCreator: Support registering custom file extensions (#231)
5.0.3 - 2022-01-10
- Replaced the
@discordjs/collection
dependency with a Collection class that has some of the features
- Fixed (potential) bug with parsing allowed mentions, allowing for formatted allowed mentions to be passed in the
formatAllowedMentions
util function
5.0.2 - 2022-01-06
- Reverted the
@discordjs/collection
dependency to0.2.1
to fall into the Node v14 version requirement (#215)- This removes the following collection functions:
reverse
,ensure
,at
andkeyAt
- This removes the following collection functions:
- types: Support disabled select menus (#211)
5.0.1 - 2021-12-24
- SlashCreator: Filter files in
registerCommandsIn
- SlashCreator: Fixed command invalidation in
reregisterCommand
5.0.0 - 2021-12-23
- SlashCreator: Removed
require-all
dependency and replacedregisterCommandsIn
options to only use strings
- SlashCreator: Add client passthrough option
- types: Removed
RequireAllOptions
type
4.4.2 - 2021-12-20
- Minimum Node Version is now v14
- SlashCreator: Fixed command invalidation when registering commands. This should allow for different instances of
slash-create
SlashCommand classes to work.
4.4.1 - 2021-12-19
- Replaced the
lodash.uniq
dependency
- FastifyServer: Fixed FastifyServer not checking for servers properly in constructor
- util: Fix
oneLine
function
4.4.0 - 2021-12-06
- ResolvedMember: Added guild-specific avatar properties and methods (#185)
- MessageInteractionContext: Added wildcard components specification to get all component events from one message (#188)
- SlashCreator: Add syncCommandsAsync
- ComponentContext: Fixed allowing editing of just components
4.3.1 - 2021-11-14
- types: Added
min_value
andmax_value
types to integer/number options (#175)
4.3.0 - 2021-10-09
- ApplicationCommandOption: Add channel type restriction option variant (#143)
- Role: Added role icon (#147)
- SlashCreator: Added global components (#145)
- MessageInteractionContext: Added custom timeout and on expiry functions (#145)
4.2.0 - 2021-09-24
- Autocomplete function to commands (#134)
- Reloading commands clears require cache
4.1.1 - 2021-09-13
- Fixed Vercel Endpoint
4.1.0 - 2021-09-13
- Support for Vercel (#121)
- Channel mentions (#120)
4.0.1 - 2021-08-17
- Fixed exports from last release
4.0.0 - 2021-08-16
- ApplicationCommandOption: removed deprecated
default
option- Reorder the required options instead.
- Permissions: removed
MANAGE_EMOJIS
permission in favor ofMANAGE_EMOJIS_AND_STICKERS
- types: removed
CommandOption
type - types: removed
FollowUpMessageOptions
in favor ofMessageOptions
- types:
RequestHandler
->ServerRequestHandler
- types:
TypedEmitter
->TypedEventEmitter
- Permissions/UserFlags:
FLAGS
constants from Permissions and UserFlags are inaccessible from the file itself. UsePermissions.FLAGS
instead. - index: Almost everything is now properly exported to index (#96)
- All files are no longer using
default
for exporting
- All files are no longer using
- MessageInteractionContext: Deleting the original message de-references the message ID from the context (#97)
- ComponentContext: Remove partial message parsing
3.5.0 - 2021-08-11
- Permissions:
MANAGE_EMOJIS
is nowMANAGE_EMOJIS_AND_STICKERS
, making the former deprecated.
- SlashCommand: Added multiple types support for context menu commands. (#94, see updated guide)
- CommandContext: Added support for resolved messages and targeted objects. (#94, see updated guide)
- Message: Added
pinned
property. - Permissions: Added
MANAGE_THREADS
,USE_PUBLIC_THREADS
,USE_PRIVATE_THREADS
andUSE_EXTERNAL_STICKERS
.
- SlashCommandAPI: The interaction callback function no longer requires a token.
3.4.3 - 2021-08-08
- ComponentContext allows for partial messages
3.4.2 - 2021-08-05
ComponentContext.message
is now a Message class rather than a partial message
3.4.1 - 2021-07-30
- Fixed bug for node versions under v14
3.4.0 - 2021-07-26
- Component callbacks have been changed internally to support other message IDs. (#84)
- Follow-up messages can now be ephemeral. (#83, 10ba62d)
- The FollowUpMessageOptions type def is deprecated.
ComponentSelectOption.description
is now optional (#80)
- Azure Functions Server (#82)
MessageInteractionContext.registerComponentFrom
to register components from other messages. (#84)
3.3.0 - 2021-07-02
- Option to manually handle command interactions (
SlashCreatorOptions.handleCommandsManually
)- If this is enabled, all command interactions will be sent through the
commandInteraction
event.
- If this is enabled, all command interactions will be sent through the
- Support for Select Components
- Types
ComponentSelectMenu
andComponentSelectOption
are exported to the index ComponentActionRow
now acceptsComponentSelectMenu
- Added
SELECT
to enumComponentType
- Added
ComponentSelectMenu
as a component alternative ofAnyComponent
- Added
values
property toComponentContext
- Types
3.2.3 - 2021-05-30
Hotfix for 3.2.2
3.2.2 - 2021-05-30
- Crashing on bad 429 responses (31f4257)
syncGlobalCommands
andsyncCommandsIn
checks for changes before updateing (fe41d87)
3.2.1 - 2021-05-27
- Fixed not having numbers allowed in option names
3.2.0 - 2021-05-27
CommandContext
andComponentContext
are now under a parent class:MessageInteractionContext
InterationResponseType
->InteractionResponseType
- Support for buttons in messages, see docs (#59)
SlashCommand.onUnload
- Types
MessageOptions
,EditMessageOptions
,FollowUpMessageOptions
, andMessageFile
are exported to the index SlashCreator.cleanRegisteredComponents
- Support for AWS Lambda, see docs (#61, @ytausch)
CommandOptionType.MENTIONABLE = 9
- Types for message embeds and attachments
- Removed ConvertedOption type
- Added peer dependency meta, which should remove the warning while installing
3.1.0 - 2021-04-16
- Removed webserver timeout.
USE_APPLICATION_COMMANDS
andREQUEST_TO_SPEAK
to the permissions bitfield.- Slash Command Permissions (#48)
- Commands now have an
ids
Map, populated upon syncing (or withSlashCreator#collectCommandIDs
). This pairs the IDs of guild IDs and'global'
to the command ID from the API. SlashCommandOptions#defaultPermissions
- You can define permissions in
SlashCommandOptions#permissions
, See here for an example.
- Commands now have an
- Fetching messages with
CommandContext#fetch
(9c876f4) Message#interaction
andMessage#messageReference
- Typing for
SlashCreatorAPI#updateCommands
3.0.1 - 2021-03-29
- Updated command option validation
- Command names and option names use the documented regex pattern
- Choice name is now 1-32 characters
- Choice description is now 1-100 characters
- Allow empty payloads when updating commands
- Prevent webservers from auto-handling interaction errors
3.0.0 - 2021-03-25
- [BREAKING]
SlashCreatorOptions#autoAcknowledgeSource
has been removed. - [BREAKING]
MessageOptions#includeSource
is removed. - [BREAKING]
InteractionResponseType.ACKNOWLEDGE
andInteractionResponseType.CHANNEL_MESSAGE
has been removed Util.objectKeySort
is now removed.
- [BREAKING]
CommandContext#acknowledge
->CommandContext#defer
- Deferred messages are like acknowledgements, but editable and used for processing requests.
CommandContext#defer
has one argument (ephemeral
) for if the deferred message should be ephemeral.
- Docs now refer "auto-acknowledge" to "auto-defer"
- Command option and subcommand limit has increased to 25
CommandContext#send
now edits a deferred message if there was a deferred message sent.- [BREAKING]
InteractionResponseType.ACKNOWLEDGE_WITH_SOURCE
->InteractionResponseType.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE
SlashCommandOptions#deferEphemeral
- Whether auto-deferring should be an ephemeral message.CommandContext#deferred
- Whether the initial response has an available deferred message.- Ability to send attachments with
CommandContext#send
- Added FAQ page in documentation
- Documentation for ResolvedMembers
SlashCommand#onBlock
andSlashCommand#onError
giving weird return types in documentation
2.1.2 - 2021-03-16
Util.objectKeySort
is now deprecated.
- Syncing commands had a major bug, sorry. (#36)
2.1.1 - 2021-03-06
- Types for most of the command options reflect on how reliable the
type
property is.
- Removed checking the
type
property within options to check for subcommand array and options. Not all clients send this type and should not be reliable.
2.1.0 - 2021-02-19
- Typings for command options have the
type
prop CommandOption
is deprecatedCommandStringOption
,CommandIntegerOption
,CommandBooleanOption
are in the index
- CommandContexts now support resolved objects
CommandContext#members
,CommandContext#users
,CommandContext#roles
,CommandContext#channels
- Note:
ResolvedMember
s inCommandContext#members
do not havemute
,deaf
andpermissions
properties.
- Updated interaction data typings with the
type
prop
2.0.0 - 2021-02-11
- The typings for
DMInteractionRequestData
andGuildInteractionRequestData
is in the index. - The typing for
InteractionRequestData
is now a type rather than an interface. - The
ping
event now has auser
parameter. - [BREAKING]
CommandContext#member
andCommandContext#guildID
is now only given in a guild context. - [BREAKING]
guildID
in command options is nowguildIDs
. - [BREAKING]
SlashCommand#guildID
has been replaced withSlashCommand#guildIDs
.
- Support for updating commands in bulk. This is now used in syncing.
- Support for multiple guild IDs in a command class.
CommandOptions#guildIDs
can either be a string or an array of strings.
- Support for direct message commands.
CommandContext#user
can be used in DM and guild contexts.
- Unnessesary command updating while syncing.
1.3.0 - 2021-01-04
- Permission bitfield now uses bigints
- Command syncing now uses
lodash.isEqual
to check for publicKey
in creator options is now optional- Typing changes
CommandOption
in constants has split off intoCommandSubcommandOption
andAnyCommandOption
, not allowing you to define options and a value.- Typings for
User
,Member
andMessage
have been set to read-only - Most undocumented typings are hidden/privated
- Export changes
- Some constant exports now exports to index:
InteractionType
,InterationResponseType
,InteractionResponseFlags
,CommandOptionType
,PartialApplicationCommand
,ApplicationCommand
,ApplicationCommandOption
,ApplicationCommandOptionChoice
,RawRequest
,AnyRequestData
,PingRequestData
,InteractionRequestData
,CommandMember
,CommandUser
,CommandData
,AnyCommandOption
,CommandOption
,CommandSubcommandOption
,ImageFormat
ConvertedOption
now exports to indexSlashCommandOptions
now exports to index
- Some constant exports now exports to index:
- Commands will automatically acknowledge after 3 seconds to avoid interaction invalidation
- You can also set
autoAcknowledgeSource
within creator options
- You can also set
- Documentation for unknown commands
Member#pending
- SlashCreator documentation
- Option validation for unknown commands
- Typings are ignored for
express
andfastify
1.2.0 - 2020-12-19
ctx.options
are a bit more consistent with sub-commands. Check the last heading in the documetation for an example.
- Support for registering/unregistering commands
- New
SlashCreator
event:commandUnregister
- New
SlashCreator
event:commandReregister
SlashCreator.reregisterCommand(command, oldCommand)
SlashCreator.unregisterCommand(command)
SlashCommand.reload()
SlashCommand.unload()
- New
- Unknown Commands
- Support for Google Cloud Functions. (
GCFServer
)
- Some documentation
- Command finalization
- Command throttling
- Command options validation
1.1.6 - 2020-12-18
- Sending options as the first argument in
Context#send
&Context#sendFollowUp
1.1.5 - 2020-12-18
- Sending options as the first argument in
Context#edit
1.1.4 - 2020-12-17
- Added more validation for options
CommandContext#subcommands
- Option choices validation
1.1.3 - 2020-12-17
- Errors in
SlashCreator#startServer
are no longer caught. - The default port is now
8030
. - Some documentation clarifying things like tokens.
- Moved
typed-emitter
to dependencies, fixing typings
1.1.2 - 2020-12-17
- Race conditions for command finalization
- Errors in
SlashCommand#onError
goes toSlashCreator#error
1.1.1 - 2020-12-17
CommandContext#options
is now a non-null object
- Loading commands in a folder
1.1.0 - 2020-12-17
This release features mostly completed documentation and changes to the packages typings. If you are using TypeScript for this package, consider this a breaking change.
- [SEMI-BREAKING] Index changes
Command
->SlashCommand
Creator
->SlashCreator
CommandContext
is aliased asContext
SlashCommand
is aliased asCommand
SlashCreator
is aliased asCreator
- If you are using any of the changed classes for typings, you must use its class name.
- i.e.
{ Creator }
must be{ SlashCreator }
- i.e.
- (typings) Renamed
AllRequestData
toAnyRequestData
- (typings) Renamed
FastifyOpts
toFastifyOptions
- (typings) Renamed duplicate
LatencyRef
interface in SequentialBucket toMinimalLatencyRef
- (typings) Added CallbackFunction type for SequentialBucket
- Fastify typings for
FastifyServer#createEndpoint
- Changed HTTP method in
SlashCommandAPI#updateCommand
fromPUT
toPATCH
User#flags
now actually usesUserFlags
- Renamed UserFlags class to the name "UserFlags"
1.0.0 - 2020-12-16
- [BREAKING]
Context.initialResponseDeleted
- [BREAKING]
treq
parameter fromSlashCreator#ping
event - The event no longer emits any parameters
- [BREAKING]
treq
parameter inSlashCreator#unknownInteraction
event is nowinteraction
- More documentation
Context.edit(messageID, content, options)
Context.editOriginal(messageID, content, options)
Context.expired
and internal handlers using thisContext.sendFollowUp(content, options)
Message
andUser
classGatewayServer
- Support for gateway eventsSlashCreatorAPI.interactionCallback(id, token, body)
Server.isWebserver
Server.handleInteraction()
- Default error messages
- Exports for Constants and CommandOptionType
0.2.0 - 2020-12-16
- [BREAKING]
Context.acknowledge
now returns a promise - [BREAKING] Removed
returnPromise
from syncCommands
- Errors will be thrown if a Server without its installed package is instantiated
- RespondFunction is now a promise
Context.send
erroring- Added/Updated debug emit lines
- ExpressServer for TypeScript
0.1.0 - 2020-12-15
- Initial release.