mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-15 08:29:25 +01:00
Use username if bot name is Slack API Tester (slack)
This commit is contained in:
parent
0cf73673a9
commit
99ce68e9ba
@ -521,6 +521,19 @@ func (b *Bslack) handleMessageEvent(ev *slack.MessageEvent) (*config.Message, er
|
||||
}
|
||||
rmsg.UserID = bot.ID
|
||||
}
|
||||
|
||||
// fixes issues with matterircd users
|
||||
if bot.Name == "Slack API Tester" {
|
||||
user, err := b.rtm.GetUserInfo(ev.User)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
rmsg.UserID = user.ID
|
||||
rmsg.Username = user.Name
|
||||
if user.Profile.DisplayName != "" {
|
||||
rmsg.Username = user.Profile.DisplayName
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// file comments are set by the system (because there is no username given)
|
||||
|
Loading…
Reference in New Issue
Block a user