Skip to content

Commit

Permalink
Fix breakage caused by reason arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev committed Jun 8, 2024
1 parent 317775c commit fdf55be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion examples/feature_showcase/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
) -> Result<(), Error> {
msg.delete(ctx).await?;
msg.delete(ctx, reason.as_deref()).await?;
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion src/dispatch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub async fn dispatch_event<U: Send + Sync + 'static, E>(
.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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/reply/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fdf55be

Please sign in to comment.