diff options
author | Wim <wim@42.be> | 2022-02-06 16:58:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-06 16:58:35 +0100 |
commit | c211152e236878b72d1a711ba0c6bef5dca07fb2 (patch) | |
tree | bc9163705765acef0bf2917ce0bda3a9866ddcfe /bridge/discord/discord.go | |
parent | ab75d5097e1f87c37f761809bb3fa3a3c44eb1f6 (diff) | |
download | matterbridge-msglm-c211152e236878b72d1a711ba0c6bef5dca07fb2.tar.gz matterbridge-msglm-c211152e236878b72d1a711ba0c6bef5dca07fb2.tar.bz2 matterbridge-msglm-c211152e236878b72d1a711ba0c6bef5dca07fb2.zip |
Add more debug options for discord (#1712)
debuglevel=1 dumps every received discord event
debuglevel=2 dumps every discord event we are sending to discord (also
logs sensitive information)
Diffstat (limited to 'bridge/discord/discord.go')
-rw-r--r-- | bridge/discord/discord.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index 9b9065f8..4e86835b 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -89,6 +89,9 @@ func (b *Bdiscord) Connect() error { b.c.AddHandler(b.messageDeleteBulk) b.c.AddHandler(b.memberAdd) b.c.AddHandler(b.memberRemove) + 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 | @@ -167,7 +170,7 @@ func (b *Bdiscord) Connect() error { return fmt.Errorf("use of removed WebhookURL setting") } - if b.GetInt("debuglevel") > 0 { + if b.GetInt("debuglevel") == 2 { b.Log.Debug("enabling even more discord debug") b.c.Debug = true } |