Implement UpdateMessage for GuildDelete

This commit is contained in:
bitfl0wer 2023-09-05 13:35:01 +02:00
parent 59ab862b17
commit c037c7907b
1 changed files with 12 additions and 1 deletions

View File

@ -80,12 +80,23 @@ impl UpdateMessage<Guild> for GuildUpdate {
} }
} }
#[derive(Debug, Default, Deserialize, Serialize, Clone)] #[derive(Debug, Default, Deserialize, Serialize, Clone, SourceUrlField, JsonField)]
/// See <https://discord.com/developers/docs/topics/gateway-events#guild-delete>; /// See <https://discord.com/developers/docs/topics/gateway-events#guild-delete>;
/// Received to tell the client about a guild being deleted; /// Received to tell the client about a guild being deleted;
pub struct GuildDelete { pub struct GuildDelete {
#[serde(flatten)] #[serde(flatten)]
pub guild: UnavailableGuild, pub guild: UnavailableGuild,
#[serde(skip)]
pub source_url: String,
#[serde(skip)]
pub json: String,
}
impl UpdateMessage<Guild> for GuildDelete {
fn id(&self) -> Option<Snowflake> {
Some(self.guild.id)
}
fn update(&mut self, _: Arc<RwLock<Guild>>) {}
} }
impl WebSocketEvent for GuildDelete {} impl WebSocketEvent for GuildDelete {}