summaryrefslogtreecommitdiffstats
path: root/bridge/discord/discord.go
diff options
context:
space:
mode:
Diffstat (limited to 'bridge/discord/discord.go')
-rw-r--r--bridge/discord/discord.go24
1 files changed, 13 insertions, 11 deletions
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go
index 5ae6c572..51dbe6bc 100644
--- a/bridge/discord/discord.go
+++ b/bridge/discord/discord.go
@@ -81,17 +81,6 @@ func (b *Bdiscord) Connect() error {
return err
}
b.Log.Info("Connection succeeded")
- b.c.AddHandler(b.messageCreate)
- b.c.AddHandler(b.messageTyping)
- b.c.AddHandler(b.messageUpdate)
- b.c.AddHandler(b.messageDelete)
- b.c.AddHandler(b.messageDeleteBulk)
- b.c.AddHandler(b.memberAdd)
- b.c.AddHandler(b.memberRemove)
- b.c.AddHandler(b.memberUpdate)
- if b.GetInt("debuglevel") == 1 {
- b.c.AddHandler(b.messageEvent)
- }
// Add privileged intent for guild member tracking. This is needed to track nicks
// for display names and @mention translation
b.c.Identify.Intents = discordgo.MakeIntent(discordgo.IntentsAllWithoutPrivileged |
@@ -233,6 +222,19 @@ func (b *Bdiscord) Connect() error {
b.nickMemberMap[member.Nick] = member
}
}
+
+ b.c.AddHandler(b.messageCreate)
+ b.c.AddHandler(b.messageTyping)
+ b.c.AddHandler(b.messageUpdate)
+ b.c.AddHandler(b.messageDelete)
+ b.c.AddHandler(b.messageDeleteBulk)
+ b.c.AddHandler(b.memberAdd)
+ b.c.AddHandler(b.memberRemove)
+ b.c.AddHandler(b.memberUpdate)
+ if b.GetInt("debuglevel") == 1 {
+ b.c.AddHandler(b.messageEvent)
+ }
+
return nil
}