Add strings.ToLower for bot username checking
This commit is contained in:
parent
f306c259b1
commit
fdcd53ffb3
@ -44,7 +44,7 @@ func (ct *Chatter) userPrivilegesCheck(update *tgbotapi.Update, user *tgbotapi.U
|
|||||||
c.Log.Debug("Checking user rights in headquarters chat...")
|
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")
|
c.Log.Debug("Game bot with username @" + update.Message.From.UserName + " passed filtration")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user