From 8411f2aa32cc8fa31e1b84baa0f4e4fbbafeb9d5 Mon Sep 17 00:00:00 2001 From: Wim Date: Mon, 10 Jul 2017 21:58:43 +0200 Subject: Lookup bot username (slack). #213 --- bridge/slack/slack.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go index 361af025..c1e324a9 100644 --- a/bridge/slack/slack.go +++ b/bridge/slack/slack.go @@ -229,6 +229,15 @@ 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++ -- cgit v1.2.3