check if user is admin in panel callback
This commit is contained in:
parent
a00b7e874b
commit
121022fb54
@ -297,6 +297,7 @@ func handleAdminCallback(bc BotController, update tgbotapi.Update, user User) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func handlePanelCallback(bc BotController, update tgbotapi.Update, user User) {
|
func handlePanelCallback(bc BotController, update tgbotapi.Update, user User) {
|
||||||
|
if !user.IsAdmin() {return}
|
||||||
if !user.IsEffectiveAdmin() {
|
if !user.IsEffectiveAdmin() {
|
||||||
bc.db.Model(&user).Update("RoleBitmask", user.RoleBitmask|0b10)
|
bc.db.Model(&user).Update("RoleBitmask", user.RoleBitmask|0b10)
|
||||||
msg := tgbotapi.NewMessage(user.ID, "You was in usermode, turned back to admin mode...")
|
msg := tgbotapi.NewMessage(user.ID, "You was in usermode, turned back to admin mode...")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user