Don't delete guild data when guild becomes unavailable
This commit is contained in:
parent
b6ff149d51
commit
9a6b65f3a3
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "reminder-rs"
|
name = "reminder-rs"
|
||||||
version = "1.7.26"
|
version = "1.7.27"
|
||||||
authors = ["Jude Southworth <judesouthworth@pm.me>"]
|
authors = ["Jude Southworth <judesouthworth@pm.me>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "AGPL-3.0 only"
|
license = "AGPL-3.0 only"
|
||||||
|
@ -55,10 +55,12 @@ To stay up to date on the latest features and fixes, join our [Discord](https://
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
FullEvent::GuildDelete { incomplete, .. } => {
|
FullEvent::GuildDelete { incomplete, .. } => {
|
||||||
|
if !incomplete.unavailable {
|
||||||
let _ = sqlx::query!("DELETE FROM guilds WHERE guild = ?", incomplete.id.get())
|
let _ = sqlx::query!("DELETE FROM guilds WHERE guild = ?", incomplete.id.get())
|
||||||
.execute(&data.database)
|
.execute(&data.database)
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
FullEvent::InteractionCreate { interaction } => {
|
FullEvent::InteractionCreate { interaction } => {
|
||||||
if let Some(component) = interaction.clone().message_component() {
|
if let Some(component) = interaction.clone().message_component() {
|
||||||
let component_model = ComponentDataModel::from_custom_id(&component.data.custom_id);
|
let component_model = ComponentDataModel::from_custom_id(&component.data.custom_id);
|
||||||
|
Loading…
Reference in New Issue
Block a user