From 7d19b49308e46317a631d00963184ffa302ad7f4 Mon Sep 17 00:00:00 2001 From: David Thomas Date: Sun, 31 Mar 2024 18:04:37 +0100 Subject: [PATCH] Fix breakage caused by reason arguments --- examples/feature_showcase/checks.rs | 3 ++- src/dispatch/mod.rs | 2 +- src/reply/mod.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/feature_showcase/checks.rs b/examples/feature_showcase/checks.rs index 892254c938cc..d2c5667719ed 100644 --- a/examples/feature_showcase/checks.rs +++ b/examples/feature_showcase/checks.rs @@ -38,8 +38,9 @@ pub async fn modonly(ctx: Context<'_>) -> Result<(), Error> { pub async fn delete( ctx: Context<'_>, #[description = "Message to be deleted"] msg: serenity::Message, + reason: Option, ) -> Result<(), Error> { - msg.delete(ctx).await?; + msg.delete(ctx, reason.as_deref()).await?; Ok(()) } diff --git a/src/dispatch/mod.rs b/src/dispatch/mod.rs index 7e44a463d552..23005855af84 100644 --- a/src/dispatch/mod.rs +++ b/src/dispatch/mod.rs @@ -125,7 +125,7 @@ pub async fn dispatch_event( .unwrap() .process_message_delete(*deleted_message_id); if let Some(bot_response) = bot_response { - if let Err(e) = bot_response.delete(framework.serenity_context).await { + if let Err(e) = bot_response.delete(framework.serenity_context, None).await { tracing::warn!("failed to delete bot response: {}", e); } } diff --git a/src/reply/mod.rs b/src/reply/mod.rs index 1551b0988ddf..576f93ab207c 100644 --- a/src/reply/mod.rs +++ b/src/reply/mod.rs @@ -144,7 +144,7 @@ impl ReplyHandle<'_> { ctx: crate::Context<'_, U, E>, ) -> Result<(), serenity::Error> { match &self.0 { - ReplyHandleInner::Prefix(msg) => msg.delete(ctx.serenity_context()).await?, + ReplyHandleInner::Prefix(msg) => msg.delete(ctx.serenity_context(), None).await?, ReplyHandleInner::Application { http: _, interaction,