diff options
author | Wim <wim@42.be> | 2017-07-10 21:58:43 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-07-10 21:58:43 +0200 |
commit | 8411f2aa32cc8fa31e1b84baa0f4e4fbbafeb9d5 (patch) | |
tree | 1384b73e8c670cfb643e4b3969674c5f3483c826 /bridge/slack/slack.go | |
parent | e8acc49cbd6285de3cf3d9bf943c3d1eaa99775d (diff) | |
download | matterbridge-msglm-8411f2aa32cc8fa31e1b84baa0f4e4fbbafeb9d5.tar.gz matterbridge-msglm-8411f2aa32cc8fa31e1b84baa0f4e4fbbafeb9d5.tar.bz2 matterbridge-msglm-8411f2aa32cc8fa31e1b84baa0f4e4fbbafeb9d5.zip |
Lookup bot username (slack). #213
Diffstat (limited to 'bridge/slack/slack.go')
-rw-r--r-- | bridge/slack/slack.go | 9 |
1 files changed, 9 insertions, 0 deletions
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++ |