}
}
-func sendMenu(chatId int64) error {
- msg := tgbotapi.NewMessage(chatId, botText)
- msg.ParseMode = tgbotapi.ModeHTML
- msg.ReplyMarkup = menuTextMarkup
- msg.DisableNotification = true
- resMsg, err := telegram.Send(msg)
- botMsg = &resMsg
- return err
-}
-
-func handleButton(query *tgbotapi.CallbackQuery) {
- var text string
-
- markup := tgbotapi.NewInlineKeyboardMarkup()
- message := query.Message
-
- if botMsg == nil {
- botMsg = message
- }
-
- if query.Data == UpdateTextBtn {
- text = botText
- markup = menuTextMarkup
- }
-
- callbackCfg := tgbotapi.NewCallback(query.ID, "")
- telegram.Send(callbackCfg)
-
- // Replace menu text and keyboard
- msg := tgbotapi.NewEditMessageTextAndMarkup(message.Chat.ID, message.MessageID, text, markup)
- msg.ParseMode = tgbotapi.ModeHTML
- telegram.Send(msg)
-}
-
// When we get a command, we react accordingly
func handleCommand(chatId int64, command string) error {
var err error
return err
}
+func sendMenu(chatId int64) error {
+ msg := tgbotapi.NewMessage(chatId, botText)
+ msg.ParseMode = tgbotapi.ModeHTML
+ msg.ReplyMarkup = menuTextMarkup
+ msg.DisableNotification = true
+ resMsg, err := telegram.Send(msg)
+ botMsg = &resMsg
+ return err
+}
+
+func handleButton(query *tgbotapi.CallbackQuery) {
+ var text string
+
+ markup := tgbotapi.NewInlineKeyboardMarkup()
+ message := query.Message
+
+ if botMsg == nil {
+ botMsg = message
+ }
+
+ if query.Data == UpdateTextBtn {
+ text = botText
+ markup = menuTextMarkup
+ }
+
+ callbackCfg := tgbotapi.NewCallback(query.ID, "")
+ telegram.Send(callbackCfg)
+
+ // Replace menu text and keyboard
+ msg := tgbotapi.NewEditMessageTextAndMarkup(message.Chat.ID, message.MessageID, text, markup)
+ msg.ParseMode = tgbotapi.ModeHTML
+ telegram.Send(msg)
+}
+
func manageSerieRequest(chatId int64, text string) error {
var err error
var response string = ""