summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-06-26 23:01:35 +0200
committerWim <wim@42.be>2017-06-26 23:01:35 +0200
commit25ac4c708fcbc9fb157791be6b4e9887741754ec (patch)
treedd3489b4867e43bca61c2706181d29f7bd6825ab
parentc268e90f492527a6d5bf9cefc9a67c67b3d8c41c (diff)
downloadmatterbridge-msglm-25ac4c708fcbc9fb157791be6b4e9887741754ec.tar.gz
matterbridge-msglm-25ac4c708fcbc9fb157791be6b4e9887741754ec.tar.bz2
matterbridge-msglm-25ac4c708fcbc9fb157791be6b4e9887741754ec.zip
Add more debugging (discord)
-rw-r--r--bridge/discord/discord.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go
index e03aaa4d..1acbb19b 100644
--- a/bridge/discord/discord.go
+++ b/bridge/discord/discord.go
@@ -109,7 +109,7 @@ 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 {
@@ -119,10 +119,10 @@ 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
}
@@ -156,7 +156,7 @@ 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
@@ -175,6 +175,7 @@ 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}