@@ -53,6 +53,10 @@ func main() {
// Register guildCreate as a callback for the guildCreate events.
dg.AddHandler(guildCreate)
+ // We need information about guilds (which includes their channels),
+ // messages and voice states.
+ dg.Identify.Intents = discordgo.MakeIntent(discordgo.IntentsGuilds | discordgo.IntentsGuildMessages | discordgo.IntentsGuildVoiceStates)
+
// Open the websocket and begin listening.
err = dg.Open()
if err != nil {
@@ -33,6 +33,9 @@ func main() {
// Register the messageCreate func as a callback for MessageCreate events.
dg.AddHandler(messageCreate)
+ // In this example, we only care about receiving message events.
+ dg.Identify.Intents = discordgo.MakeIntent(discordgo.IntentsGuildMessages)
// Open a websocket connection to Discord and begin listening.