Updating from v3 to v4
Before you start
It is important to note that the primary breaking change of Sapphire v4 is support for DiscordJS v14.x. This means that for most of the breaking changes you should refer to DiscordJS' upgrade guide.
Sapphire specific changes
Sapphire has a few changes that are not related to DiscordJS. These are not necessarily breaking changes but should be noted nonetheless.
- The
Identifiersenum was changed fromconst enumtoenum. - The
CommandOptionsRunTypeEnumenum was changed fromconst enumtoenum. - The
CommandPreConditionsenum was changed fromconst enumtoenum. - The
InteractionHandlerTypesenum was changed fromconst enumtoenum. - The
LogLevelenum was changed fromconst enumtoenum. - The
PreconditionRunModeenum was changed fromconst enumtoenum. - The type alias
Command.ChatInputInteractionwas changed toCommand.ChatInputCommandInteraction. - The type alias
Command.ContextMenuInteractionwas changed toCommand.ContextMenuCommandInteraction. - The
default_permissionoption for Application Commands has been removed to match the removal on the discord.js and Discord API side.
DiscordJS specific changes
The new update on how intents are enabled requires you to have GatewayIntentBits.MessageContent as an intent if the
bot uses message commands or requires content, attachments, embeds and components from messages, even if you
already have GatewayIntentBits.GuildMessages in your intents.