This repository has been archived on 2022-11-04. You can view files and clone it, but cannot push or open issues/pull-requests.
2017-12-23 01:40:36 +04:00
|
|
|
|
// i2_bot – Instinct PokememBro Bot
|
|
|
|
|
// Copyright (c) 2017 Vladimir "fat0troll" Hodakov
|
|
|
|
|
|
|
|
|
|
package reminder
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/go-telegram-bot-api/telegram-bot-api"
|
2018-01-21 23:28:53 +04:00
|
|
|
|
"git.wtfteam.pro/fat0troll/i2_bot/lib/dbmapping"
|
2017-12-23 01:40:36 +04:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// AlarmsList lists all alarms for user with buttons to enable/disable each of available alarms
|
|
|
|
|
func (r *Reminder) AlarmsList(update *tgbotapi.Update, playerRaw *dbmapping.Player) string {
|
|
|
|
|
msg := tgbotapi.MessageConfig{}
|
|
|
|
|
msg.Text = r.formatRemindersMessageText(playerRaw)
|
|
|
|
|
msg.ParseMode = "Markdown"
|
|
|
|
|
msg.ChatID = update.Message.Chat.ID
|
|
|
|
|
|
|
|
|
|
remindersMsg, _ := c.Bot.Send(msg)
|
|
|
|
|
|
|
|
|
|
keyboard := r.formatRemindersButtons(playerRaw)
|
|
|
|
|
buttonsUpdate := tgbotapi.NewEditMessageReplyMarkup(update.Message.Chat.ID, remindersMsg.MessageID, keyboard)
|
|
|
|
|
c.Bot.Send(buttonsUpdate)
|
|
|
|
|
|
|
|
|
|
return "ok"
|
|
|
|
|
}
|