Skip to content

Commit

Permalink
Remove unused Context parameter in process_message function
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kasugamirai committed Feb 23, 2024
1 parent 2f06200 commit 0cdee5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/discord/bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl Handler {
Ok(Self { gpt_client })
}

async fn process_message(&self, ctx: Context, msg: Message) -> Option<String> {
async fn process_message(&self, msg: Message) -> Option<String> {
if msg.author.bot || !msg.content.starts_with(".") {
return None;
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 0cdee5c

Please sign in to comment.