Don't delete guild data when guild becomes unavailable

This commit is contained in:
jude 2024-09-17 23:47:27 +01:00
parent b6ff149d51
commit 9a6b65f3a3
2 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "reminder-rs"
version = "1.7.26"
version = "1.7.27"
authors = ["Jude Southworth <judesouthworth@pm.me>"]
edition = "2021"
license = "AGPL-3.0 only"

View File

@ -55,9 +55,11 @@ To stay up to date on the latest features and fixes, join our [Discord](https://
}
}
FullEvent::GuildDelete { incomplete, .. } => {
let _ = sqlx::query!("DELETE FROM guilds WHERE guild = ?", incomplete.id.get())
.execute(&data.database)
.await;
if !incomplete.unavailable {
let _ = sqlx::query!("DELETE FROM guilds WHERE guild = ?", incomplete.id.get())
.execute(&data.database)
.await;
}
}
FullEvent::InteractionCreate { interaction } => {
if let Some(component) = interaction.clone().message_component() {