Intents
Bot intents
Intents
were introduced by Discord so that bot developers can choose which events their bot receives based on what data it needs to function. In order for a given event to be emitted, a related intent needs to be enabled.
For example, one of the most used events in Discord bots is guildMemberAdd
, this event is emitted when a member joins the guild, but it is necessary to set the GuildMembers
intent for the event to be emitted.
When generating this project, by default all intents are enabled in the Client
. See below what a simple code would look like without using Constatic Base:
But it is not necessary to set any intent, because by default, they are all already enabled:
However, if you want to set only specific intents, as in the case of a public bot where you do not want to enable the MessageContent
intent, simply use the intents
property of the bootstrap
function, it is the same as the Client
options: