From 5bf51ebf676151a235f07659410316c59347b970 Mon Sep 17 00:00:00 2001 From: rigormorrtiss Date: Tue, 20 Jul 2021 15:51:44 +0400 Subject: [PATCH] Only add intents for bot accounts --- discordo.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/discordo.go b/discordo.go index 30eda99..9e6a8f8 100644 --- a/discordo.go +++ b/discordo.go @@ -103,11 +103,15 @@ func newSession(email string, password string, token string) *session.Session { panic(err) } - sess.AddHandler(onGuildCreate) - sess.Gateway.AddIntents(gateway.IntentGuilds) - sess.Gateway.AddIntents(gateway.IntentGuildMessages) + if strings.HasPrefix(token, "Bot ") { + sess.Gateway.AddIntents(gateway.IntentGuilds) + sess.Gateway.AddIntents(gateway.IntentGuildMessages) + } else { + sess.AddHandler(onReady) + } } + sess.AddHandler(onGuildCreate) sess.AddHandler(onMessageCreate) if err = sess.Open(); err != nil { panic(err)