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
Identifiers
enum was changed fromconst enum
toenum
. - The
CommandOptionsRunTypeEnum
enum was changed fromconst enum
toenum
. - The
CommandPreConditions
enum was changed fromconst enum
toenum
. - The
InteractionHandlerTypes
enum was changed fromconst enum
toenum
. - The
LogLevel
enum was changed fromconst enum
toenum
. - The
PreconditionRunMode
enum was changed fromconst enum
toenum
. - The type alias
Command.ChatInputInteraction
was changed toCommand.ChatInputCommandInteraction
. - The type alias
Command.ContextMenuInteraction
was changed toCommand.ContextMenuCommandInteraction
. - The
default_permission
option 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.