Skip to content

Commit

Permalink
Ignore unavailable guilds in guild delete events
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev committed Dec 17, 2023
1 parent ad10126 commit 4888bf6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/events/guild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ pub async fn guild_delete(
incomplete: &serenity::UnavailableGuild,
full: Option<&serenity::Guild>,
) -> Result<()> {
if incomplete.unavailable {
return Ok(());
}

data.guilds_db.delete(incomplete.id.into()).await?;

let Some(guild) = full else { return Ok(()) };
Expand Down

0 comments on commit 4888bf6

Please sign in to comment.