slack: test checking both user and username when we have a botID

This commit is contained in:
Chris Sexton 2017-11-12 12:43:40 -05:00
parent 20bf8748a2
commit f5f70bbdc8
1 changed files with 3 additions and 0 deletions

View File

@ -395,6 +395,9 @@ func (s *Slack) Serve() error {
botOK := true
if msg.BotID != "" {
u, _ := s.getUser(msg.User)
if u == "" && msg.Username != "" {
u = msg.Username
}
log.Printf("User: %s, BotList: %+v", u, s.config.BotList)
botOK = s.config.BotList[strings.Title(u)]
}