CodingTrain / Discord-Bot-Examples

Bot Examples for Fall 2023
18 stars 6 forks source link

Remove intent, use Event constant #14

Closed dipamsen closed 11 months ago

dipamsen commented 11 months ago

Fixes #12

dipamsen commented 11 months ago

Fixed!

shiffman commented 11 months ago

Why do you think the discord.js guide includes this intent?

dipamsen commented 11 months ago

From discordjs.guide:

The GatewayIntentBits.Guilds intents option is necessary for the discord.js client to work as you expect it to, as it ensures that the caches for guilds, channels, and roles are populated and available for internal use.

So looks like even if we don't actually listen to guild events, discord.js behind the scenes uses them to populate client.guilds, client.guild.channels etc. This is not used in the current example, but will be needed when working with guild stuff later.

shiffman commented 11 months ago

Thank you!