Skip to content
Advertisement

Discord.Intents(32767) vs [Intents.FLAGS.GUILDS]?

Do you know why the “message sent” is displayed only with the first solution?

JavaScript

And not with this? (That is the example code on the discord.js documentation.)

JavaScript

The bot is ready in both solutions, but I don’t get why only in the first one when I send a message in the server the bot detects it, maybe because I don’t know what does mean “32767”.

Advertisement

Answer

The number 32767 means ALL_INTENTS. The Intents class extends a BitField. Meaning that you can represent all the intents you want via a single number by filling in specific bits of the bitfield.

According to Discord Developer Portal, this is how each flag is represented by a bit shift.

JavaScript

Do you know why the “message sent” is displayed only with the first solution?

Because in the second solution, you are missing GUILD_MESSAGES intent to receive the messageCreate event.

Advertisement