5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-12-24 18:25:40 +00:00

Lookup bot username (slack). #213

This commit is contained in:
Wim 2017-07-10 21:58:43 +02:00
parent e8acc49cbd
commit 8411f2aa32

View File

@ -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++