Explorar o código

Add GUILDS and GUILD_MESSAGES intents for bots

rigormorrtiss %!s(int64=4) %!d(string=hai) anos
pai
achega
aeaf245fb5
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      discordo.go

+ 3 - 0
discordo.go

@@ -90,6 +90,9 @@ func newSession(email string, password string, token string) *session.Session {
 
 		if !strings.HasPrefix(token, "Bot ") {
 			sess.AddHandler(onReady)
+		} else {
+			sess.Gateway.AddIntents(gateway.IntentGuilds)
+			sess.Gateway.AddIntents(gateway.IntentGuildMessages)
 		}
 	}