From 0cdee5c6ea89ab02e5aac4cf3f64b9fc54dde9b1 Mon Sep 17 00:00:00 2001 From: xy Date: Sat, 24 Feb 2024 00:27:54 +0900 Subject: [PATCH] Remove unused Context parameter in process_message function The function process_message in discord bot code no longer requires the Context parameter, improving readability and simplifying function calls. This removal accounts for changes in the bot's design where the context is no longer necessary for processing Discord messages. --- src/discord/bot.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/discord/bot.rs b/src/discord/bot.rs index b175ddb..fe47339 100644 --- a/src/discord/bot.rs +++ b/src/discord/bot.rs @@ -24,7 +24,7 @@ impl Handler { Ok(Self { gpt_client }) } - async fn process_message(&self, ctx: Context, msg: Message) -> Option { + async fn process_message(&self, msg: Message) -> Option { if msg.author.bot || !msg.content.starts_with(".") { return None; } @@ -57,7 +57,7 @@ impl Handler { #[async_trait] impl EventHandler for Handler { async fn message(&self, ctx: Context, msg: Message) { - if let Some(result) = self.process_message(ctx.clone(), msg.clone()).await { + if let Some(result) = self.process_message(msg.clone()).await { let processing_future = msg.channel_id.say(&ctx.http, "Processing..."); match processing_future.await {