No longer logging the error in the delete_message callback

This commit is contained in:
StNicolay 2023-06-05 10:58:29 +03:00
parent f74d34f188
commit 9720fec16a
Signed by: StNicolay
GPG Key ID: 9693D04DCD962B0D

View File

@ -4,12 +4,10 @@ use teloxide::{adaptors::Throttle, dispatching::DpHandlerDescription, prelude::*
/// Deletes the message from the callback
async fn run(bot: Throttle<Bot>, q: CallbackQuery) -> crate::Result<()> {
if let Some(msg) = q.message {
if let Err(err) = bot.delete_message(msg.chat.id, msg.id).await {
let _ = bot
.send_message(msg.chat.id, "Error deleting the message")
if bot.delete_message(msg.chat.id, msg.id).await.is_err() {
bot.send_message(msg.chat.id, "Error deleting the message")
.reply_markup(deletion_markup())
.await;
return Err(err.into());
.await?;
}
}
Ok(())