Attempt to patch "Call not found" errors

This commit is contained in:
2025-08-24 20:06:09 -03:00
parent 3f5ec4f258
commit 82fba989a4
+5 -2
View File
@@ -271,7 +271,7 @@ impl Command<State, Extras> for HangupCommand {
ctx: CommandContext<'_, State, Extras>, ctx: CommandContext<'_, State, Extras>,
_args: &str, _args: &str,
) -> Result<(), CommandError> { ) -> 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 .await
.inspect_err(|e| log::error!("Failed to get channel: {e:?}"))? .inspect_err(|e| log::error!("Failed to get channel: {e:?}"))?
else { else {
@@ -305,7 +305,10 @@ impl Command<State, Extras> for HangupCommand {
.await .await
.inspect_err(|e| log::error!("Failed to get call: {e:?}"))? .inspect_err(|e| log::error!("Failed to get call: {e:?}"))?
else { 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); return Err(CommandError::DatabaseInconsistentState);
}; };