diff --git a/_example/advanced_bot/main.go b/_example/advanced_bot/main.go index df45eec..69d2cdd 100644 --- a/_example/advanced_bot/main.go +++ b/_example/advanced_bot/main.go @@ -1,3 +1,5 @@ +// Package main demonstrates an advanced bot that uses the bot router library to +// make commands. package main import ( @@ -24,6 +26,10 @@ func main() { // Subcommand demo, but this can be in another package. ctx.MustRegisterSubcommand(&Debug{}) + // The bot package will automatically derive out Gateway intents. It + // might not catch everything though, so a ctx.Gateway.AddIntents is + // always available. + return nil }) diff --git a/_example/simple/main.go b/_example/simple/main.go index c18441b..fa67392 100644 --- a/_example/simple/main.go +++ b/_example/simple/main.go @@ -1,3 +1,5 @@ +// Package main demonstrates a bare simple bot without a state cache. It logs +// all messages it sees into stderr. package main import ( @@ -30,6 +32,10 @@ func main() { } defer s.Close() + // Add the needed Gateway intents. + s.Gateway.AddIntents(gateway.IntentGuildMessages) + s.Gateway.AddIntents(gateway.IntentDirectMessages) + u, err := s.Me() if err != nil { log.Fatalln("Failed to get myself:", err) diff --git a/_example/undeleter/main.go b/_example/undeleter/main.go index 6a8eae9..fc58b28 100644 --- a/_example/undeleter/main.go +++ b/_example/undeleter/main.go @@ -1,3 +1,4 @@ +// Package main demonstrates the PreHandler API of the State. package main import ( @@ -35,6 +36,10 @@ func main() { } }) + // Add the needed Gateway intents. + s.Gateway.AddIntents(gateway.IntentGuildMessages) + s.Gateway.AddIntents(gateway.IntentDirectMessages) + if err := s.Open(); err != nil { log.Fatalln("Failed to connect:", err) }