Archived
1

Add strings.ToLower for bot username checking

This commit is contained in:
Vladimir Hodakov 2018-04-07 17:24:48 +04:00
parent f306c259b1
commit fdcd53ffb3

View File

@ -44,7 +44,7 @@ func (ct *Chatter) userPrivilegesCheck(update *tgbotapi.Update, user *tgbotapi.U
c.Log.Debug("Checking user rights in headquarters chat...")
}
if update.Message.Chat.ID == gamesChatID && strings.Contains(user.UserName, "bot") {
if update.Message.Chat.ID == gamesChatID && strings.Contains(strings.ToLower(user.UserName), "bot") {
c.Log.Debug("Game bot with username @" + update.Message.From.UserName + " passed filtration")
return true
}