Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 92cd69e1493c1d327e2926ceadc19abc84254720 Author: Wim <wim@42.be> Date: Mon Jun 26 23:01:35 2017 +0000 Add more debugging (discord) diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go index e03aaa4..1acbb19 100644 --- a/bridge/discord/discord.go +++ b/bridge/discord/discord.go @@ -1097 +1097 @@ func (b *bdiscord) Send(msg config.Message) error {   flog.Errorf("Could not find channelID for %v", msg.Channel)   return nil   } - if b.Config.WebhookURL == ""{ + if b.Config.WebhookURL == "" {   flog.Debugf("Broadcasting using API")   b.c.ChannelMessageSend(channelID, msg.Username+msg.Text)   } else { @@ -11910 +11910 @@ func (b *bdiscord) Send(msg config.Message) error {   b.webhookToken,   true,   &discordgo.WebhookParams{ - Content: msg.Text, - Username: msg.Username, + Content: msg.Text, + Username: msg.Username,   AvatarURL: msg.Avatar, - }) + })   }   return nil  } @@ -1567 +1567 @@ func (b *bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat   if m.Content == "" {   return   } - flog.Debugf("Sending message from %s on %s to gateway", m.Author.Username, b.Account) + flog.Debugf("Receiving message %#v", m.Message)   channelName := b.getChannelName(m.ChannelID)   if b.UseChannelID {   channelName = "ID:" + m.ChannelID @@ -1756 +1757 @@ func (b *bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat   }   }   + flog.Debugf("Sending message from %s on %s to gateway", m.Author.Username, b.Account)   b.Remote <- config.Message{Username: username, Text: text, Channel: channelName,   Account: b.Account, Avatar: "https://cdn.discordapp.com/avatars/" + m.Author.ID + "/" + m.Author.Avatar + ".jpg",   UserID: m.Author.ID}