hdkv
/
i2_bot
Archived
1
Fork 0

Reminders message update with less waiting

It will update in one step, not in two
master
Vladimir Hodakov 2017-12-23 01:56:18 +04:00
parent 706dc3e944
commit 2bcb89f74a
1 changed files with 10 additions and 4 deletions

View File

@ -31,9 +31,12 @@ func (r *Reminder) CreateAlarmSetting(update *tgbotapi.Update, playerRaw *dbmapp
return "fail"
}
message := r.formatRemindersMessageText(playerRaw)
keyboard := r.formatRemindersButtons(playerRaw)
buttonsUpdate := tgbotapi.NewEditMessageReplyMarkup(update.CallbackQuery.Message.Chat.ID, update.CallbackQuery.Message.MessageID, keyboard)
c.Bot.Send(buttonsUpdate)
messageUpdate := tgbotapi.NewEditMessageText(update.CallbackQuery.Message.Chat.ID, update.CallbackQuery.Message.MessageID, message)
messageUpdate.ParseMode = "Markdown"
messageUpdate.ReplyMarkup = &keyboard
c.Bot.Send(messageUpdate)
return "ok"
}
@ -52,9 +55,12 @@ func (r *Reminder) DestroyAlarmSetting(update *tgbotapi.Update, playerRaw *dbmap
c.Log.Error(err.Error())
}
message := r.formatRemindersMessageText(playerRaw)
keyboard := r.formatRemindersButtons(playerRaw)
buttonsUpdate := tgbotapi.NewEditMessageReplyMarkup(update.CallbackQuery.Message.Chat.ID, update.CallbackQuery.Message.MessageID, keyboard)
c.Bot.Send(buttonsUpdate)
messageUpdate := tgbotapi.NewEditMessageText(update.CallbackQuery.Message.Chat.ID, update.CallbackQuery.Message.MessageID, message)
messageUpdate.ParseMode = "Markdown"
messageUpdate.ReplyMarkup = &keyboard
c.Bot.Send(messageUpdate)
return "ok"
}