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/handlers.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/handlers.go')
-rw-r--r-- | bridge/discord/handlers.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bridge/discord/handlers.go b/bridge/discord/handlers.go index 81a0e11c..42c5f383 100644 --- a/bridge/discord/handlers.go +++ b/bridge/discord/handlers.go @@ -2,6 +2,7 @@ package bdiscord import ( "github.com/42wim/matterbridge/bridge/config" + "github.com/davecgh/go-spew/spew" "github.com/matterbridge/discordgo" ) @@ -31,6 +32,10 @@ func (b *Bdiscord) messageDeleteBulk(s *discordgo.Session, m *discordgo.MessageD } } +func (b *Bdiscord) messageEvent(s *discordgo.Session, m *discordgo.Event) { + b.Log.Debug(spew.Sdump(m.Struct)) +} + func (b *Bdiscord) messageTyping(s *discordgo.Session, m *discordgo.TypingStart) { if !b.GetBool("ShowUserTyping") { return @@ -82,8 +87,9 @@ func (b *Bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat rmsg := config.Message{Account: b.Account, Avatar: "https://cdn.discordapp.com/avatars/" + m.Author.ID + "/" + m.Author.Avatar + ".jpg", UserID: m.Author.ID, ID: m.ID} + b.Log.Debugf("== Receiving event %#v", m.Message) + if m.Content != "" { - b.Log.Debugf("== Receiving event %#v", m.Message) m.Message.Content = b.replaceChannelMentions(m.Message.Content) rmsg.Text, err = m.ContentWithMoreMentionsReplaced(b.c) if err != nil { |