summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2023-03-11 17:55:11 +0100
committerGitHub <noreply@github.com>2023-03-11 17:55:11 +0100
commit356ada872c0e1564097e2f8165931fb8c9ee9d23 (patch)
tree944240d778f5d85b29f1f7c84e7b6cbc9edf766b
parenta3deb4872656389425c8d3b9abb7c7d428bb8fe7 (diff)
downloadmatterbridge-msglm-356ada872c0e1564097e2f8165931fb8c9ee9d23.tar.gz
matterbridge-msglm-356ada872c0e1564097e2f8165931fb8c9ee9d23.tar.bz2
matterbridge-msglm-356ada872c0e1564097e2f8165931fb8c9ee9d23.zip
Add handlers at the end. Fixes #1988 (discord) (#2011)
-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
}