Reminders message update with less waiting
It will update in one step, not in two
This commit is contained in:
parent
706dc3e944
commit
2bcb89f74a
@ -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"
|
||||
}
|
||||
|
Reference in New Issue
Block a user