From 82fba989a4f32c2f6f028be7342bcd170b6b4b96 Mon Sep 17 00:00:00 2001 From: Rafael Bradley Date: Sun, 24 Aug 2025 20:06:09 -0300 Subject: [PATCH] Attempt to patch "Call not found" errors --- src/groups/calls/commands.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/groups/calls/commands.rs b/src/groups/calls/commands.rs index 0f7e908..63e6fa0 100644 --- a/src/groups/calls/commands.rs +++ b/src/groups/calls/commands.rs @@ -271,7 +271,7 @@ impl Command for HangupCommand { ctx: CommandContext<'_, State, Extras>, _args: &str, ) -> Result<(), CommandError> { - let Some(channel) = Channel::get_by_id(ctx.event.channel_id.get(), &ctx.rt.state.db) + let Some(mut channel) = Channel::get_by_id(ctx.event.channel_id.get(), &ctx.rt.state.db) .await .inspect_err(|e| log::error!("Failed to get channel: {e:?}"))? else { @@ -305,7 +305,10 @@ impl Command for HangupCommand { .await .inspect_err(|e| log::error!("Failed to get call: {e:?}"))? else { - ctx.send().content("❌ Call not found.").await?; + ctx.send().content("❌ The call could not be found.\n-# This is not supposed to happen. If the issue persists, contact a moderator in the official server.").await?; + + channel.call_id = None; + channel.upsert(&ctx.rt.state.db).await?; return Err(CommandError::DatabaseInconsistentState); };