Attempt to patch "Call not found" errors
This commit is contained in:
@@ -271,7 +271,7 @@ impl Command<State, Extras> 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<State, Extras> 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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user