Skip to content

Commit

Permalink
fix: explicitly set desired intents.
Browse files Browse the repository at this point in the history
  • Loading branch information
myrkvi committed Oct 1, 2024
1 parent 4f032f8 commit be80e1b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ import (
var rmGlobalCommands = flag.Bool("rm-global-commands", false, "Remove global commands")
var rmGuildCommands = flag.Uint64("rm-guild-commands", 0, "Remove guild commands for guild specified by ID")

var intents = gateway.IntentGuilds |
gateway.IntentGuildMembers |
gateway.IntentGuildModeration |
gateway.IntentGuildEmojisAndStickers |
gateway.IntentGuildIntegrations |
gateway.IntentGuildWebhooks |
gateway.IntentGuildInvites |
gateway.IntentGuildVoiceStates |
gateway.IntentGuildMessages |
gateway.IntentGuildMessageReactions |
gateway.IntentDirectMessages |
gateway.IntentDirectMessageReactions |
gateway.IntentMessageContent |
gateway.IntentGuildScheduledEvents |
gateway.IntentAutoModerationConfiguration |
gateway.IntentAutoModerationExecution |
gateway.IntentGuildMessagePolls |
gateway.IntentDirectMessagePolls

func main() {
flag.Parse()
token := viper.GetString("bot.token")
Expand Down Expand Up @@ -125,7 +144,7 @@ func main() {
bot.WithEventListenerFunc(listeners.OnUserLeave),
bot.WithEventListenerFunc(listeners.OnMemberBan),
bot.WithEventListenerFunc(listeners.OnAuditLog),
bot.WithGatewayConfigOpts(gateway.WithIntents(gateway.IntentsAll)),
bot.WithGatewayConfigOpts(gateway.WithIntents(intents)),
bot.WithCacheConfigOpts(
cache.WithCaches(cache.FlagsAll),
),
Expand Down

0 comments on commit be80e1b

Please sign in to comment.