diff options
author | James Lu <james@overdrivenetworks.com> | 2021-03-20 14:46:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-20 22:46:36 +0100 |
commit | 2a7f28606c4984a37c89b0c90cfa986a602d1e77 (patch) | |
tree | ec3aa7e99bc0800478bc9d40c6695fecd27355c9 | |
parent | 0450482e6ebed8a379f2d43f0ee264ea0d130a31 (diff) | |
download | matterbridge-msglm-2a7f28606c4984a37c89b0c90cfa986a602d1e77.tar.gz matterbridge-msglm-2a7f28606c4984a37c89b0c90cfa986a602d1e77.tar.bz2 matterbridge-msglm-2a7f28606c4984a37c89b0c90cfa986a602d1e77.zip |
Declare GUILD_MEMBERS privileged intent (discord) (#1428)
Without this declared, it seems that Discord will not send any member update
events after connection, even if the privileged gateway intent is enabled for
the bot in settings. This causes nick tracking to get out of sync when people
change their nicks after the bot connects.
See: https://discord.com/developers/docs/topics/gateway#gateway-intents
-rw-r--r-- | bridge/discord/discord.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 5f28a3bd..9cc83ddc 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -75,6 +75,11 @@ func (b *Bdiscord) Connect() error { b.c.AddHandler(b.messageDeleteBulk) b.c.AddHandler(b.memberAdd) b.c.AddHandler(b.memberRemove) + // 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 | + discordgo.IntentsGuildMembers) + err = b.c.Open() if err != nil { return err |