From 121022fb54853f67d310d5ae3b2112c16251433b Mon Sep 17 00:00:00 2001 From: Akulij Date: Thu, 27 Mar 2025 22:24:58 +0800 Subject: [PATCH] check if user is admin in panel callback --- cmd/app/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/app/main.go b/cmd/app/main.go index 3869689..144a65d 100644 --- a/cmd/app/main.go +++ b/cmd/app/main.go @@ -297,6 +297,7 @@ func handleAdminCallback(bc BotController, update tgbotapi.Update, user User) { } func handlePanelCallback(bc BotController, update tgbotapi.Update, user User) { + if !user.IsAdmin() {return} if !user.IsEffectiveAdmin() { bc.db.Model(&user).Update("RoleBitmask", user.RoleBitmask|0b10) msg := tgbotapi.NewMessage(user.ID, "You was in usermode, turned back to admin mode...")