Compare commits
2 Commits
22aabb7531
...
8a469a09b8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a469a09b8 | ||
|
|
15a87b282c |
@ -122,6 +122,7 @@ func ProcessUpdate(bc BotController, update tgbotapi.Update) {
|
||||
log.Printf("Args: %s", args)
|
||||
|
||||
if possibleCommand == "/start" {
|
||||
bc.db.Model(&user).Update("state", "start")
|
||||
kbd := tgbotapi.NewInlineKeyboardMarkup(
|
||||
tgbotapi.NewInlineKeyboardRow(
|
||||
tgbotapi.NewInlineKeyboardButtonData(bc.GetBotContent("leave_ticket_button"), "leave_ticket_button"),
|
||||
@ -154,7 +155,8 @@ func ProcessUpdate(bc BotController, update tgbotapi.Update) {
|
||||
} else if possibleCommand == "/id" && user.IsAdmin() {
|
||||
log.Printf("THERe")
|
||||
bc.bot.Send(tgbotapi.NewMessage(update.Message.Chat.ID, strconv.FormatInt(update.Message.Chat.ID, 10)))
|
||||
} else if possibleCommand == "/secret" && args[0] == bc.cfg.AdminPass {
|
||||
} else if possibleCommand == "/secret" && len(args) > 0 && args[0] == bc.cfg.AdminPass {
|
||||
bc.db.Model(&user).Update("state", "start")
|
||||
bc.db.Model(&user).Update("RoleBitmask", user.RoleBitmask | 0b11) // set real admin ID (0b1) and effective admin toggle (0b10)
|
||||
msg := tgbotapi.NewMessage(update.Message.Chat.ID, "You are admin now!")
|
||||
bc.bot.Send(msg)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user