Only add intents for bot accounts
This commit is contained in:
parent
760b29fa29
commit
5bf51ebf67
1 changed files with 7 additions and 3 deletions
10
discordo.go
10
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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue