check if user is admin in panel callback

This commit is contained in:
Akulij 2025-03-27 22:24:58 +08:00
parent a00b7e874b
commit 121022fb54

View File

@ -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...")