From fdcd53ffb3389af7d557024de68278f5e84fe589 Mon Sep 17 00:00:00 2001 From: Vladimir Hodakov Date: Sat, 7 Apr 2018 17:24:48 +0400 Subject: [PATCH] Add strings.ToLower for bot username checking --- lib/chatter/restricters.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chatter/restricters.go b/lib/chatter/restricters.go index b8f760b..5dd56d6 100644 --- a/lib/chatter/restricters.go +++ b/lib/chatter/restricters.go @@ -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 }