From c81e7812473c3f155a6b413eeea6fc8110017f7a Mon Sep 17 00:00:00 2001 From: Akulij Date: Thu, 27 Mar 2025 20:41:41 +0800 Subject: [PATCH] add admin commands map to handlers --- cmd/app/main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/app/main.go b/cmd/app/main.go index ec4bf34..d603153 100644 --- a/cmd/app/main.go +++ b/cmd/app/main.go @@ -16,6 +16,15 @@ import ( "gorm.io/gorm" ) +var adminCommands = map[string]func(BotController, tgbotapi.Update){ + "/secret": handleMessage, // activate admin mode via /secret `AdminPass` + "/panel": handleMessage, // open bot settings + "/usermode": handleMessage, // temporarly disable admin mode to test ui + "/id": handleMessage, // to check id of chat + "/setchannelid": handleMessage, // just type it in channel which one is + // supposed to be lined with bot +} + type BotController struct { cfg config.Config bot *tgbotapi.BotAPI