No longer logging the error in the delete_message callback
This commit is contained in:
parent
f74d34f188
commit
9720fec16a
@ -4,12 +4,10 @@ use teloxide::{adaptors::Throttle, dispatching::DpHandlerDescription, prelude::*
|
|||||||
/// Deletes the message from the callback
|
/// Deletes the message from the callback
|
||||||
async fn run(bot: Throttle<Bot>, q: CallbackQuery) -> crate::Result<()> {
|
async fn run(bot: Throttle<Bot>, q: CallbackQuery) -> crate::Result<()> {
|
||||||
if let Some(msg) = q.message {
|
if let Some(msg) = q.message {
|
||||||
if let Err(err) = bot.delete_message(msg.chat.id, msg.id).await {
|
if bot.delete_message(msg.chat.id, msg.id).await.is_err() {
|
||||||
let _ = bot
|
bot.send_message(msg.chat.id, "Error deleting the message")
|
||||||
.send_message(msg.chat.id, "Error deleting the message")
|
|
||||||
.reply_markup(deletion_markup())
|
.reply_markup(deletion_markup())
|
||||||
.await;
|
.await?;
|
||||||
return Err(err.into());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user