From 703068d8a01c9333d9010c44ce8522a94fa5ba5a Mon Sep 17 00:00:00 2001 From: Andre Julius Date: Fri, 3 May 2024 00:44:49 +0200 Subject: [PATCH] Use Http instead of CacheHttp --- src/dispatch/mod.rs | 3 ++- src/reply/mod.rs | 2 +- src/reply/send_reply.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dispatch/mod.rs b/src/dispatch/mod.rs index 23005855af84..d8df7882b8e3 100644 --- a/src/dispatch/mod.rs +++ b/src/dispatch/mod.rs @@ -9,6 +9,7 @@ pub use prefix::*; pub use slash::*; use crate::serenity_prelude as serenity; +use serenity::all::CacheHttp; /// A view into data stored by [`crate::Framework`] pub struct FrameworkContext<'a, U, E> { @@ -125,7 +126,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, None).await { + if let Err(e) = bot_response.delete(framework.serenity_context.http(), None).await { tracing::warn!("failed to delete bot response: {}", e); } } diff --git a/src/reply/mod.rs b/src/reply/mod.rs index 576f93ab207c..d85512cb942e 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(), None).await?, + ReplyHandleInner::Prefix(msg) => msg.delete(ctx.http(), None).await?, ReplyHandleInner::Application { http: _, interaction, diff --git a/src/reply/send_reply.rs b/src/reply/send_reply.rs index b127f908938d..12d6af47330c 100644 --- a/src/reply/send_reply.rs +++ b/src/reply/send_reply.rs @@ -154,7 +154,7 @@ pub async fn send_prefix_reply<'a, U: Send + Sync + 'static, E>( let new_response = ctx .msg .channel_id - .send_message(ctx.serenity_context(), builder.to_prefix(ctx.msg.into())) + .send_message(ctx.http(), builder.to_prefix(ctx.msg.into())) .await?; // We don't check ctx.command.reuse_response because we need to store bot responses for // track_deletion too