Thumbnail

rani/matterbridge.git

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

commit 952fef8d87713086d519ef20c56228b9d70ff965 Author: Wim <wim@42.be> Date: Mon Jul 10 21:58:43 2017 +0000 Lookup bot username (slack). #213 diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 361af02..c1e324a 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -2296 +22915 @@ func (b *Bslack) handleSlackClient(mchan chan *MMMessage) {   m.Text = ev.Text   m.Raw = ev   m.Text = b.replaceMention(m.Text) + if ev.BotID != "" && user.Name == "" { + bot, err := b.rtm.GetBotInfo(ev.BotID) + if err != nil { + continue + } + if bot.Name != "" { + m.Username = bot.Name + } + }   mchan <- m   }   count++