From b3bbff5c366a8e7c74e3238a58982ae73f19b0a8 Mon Sep 17 00:00:00 2001 From: bitfl0wer Date: Tue, 5 Sep 2023 13:35:01 +0200 Subject: [PATCH] Implement UpdateMessage for GuildDelete --- src/types/events/guild.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/types/events/guild.rs b/src/types/events/guild.rs index b0126c60..faf713bc 100644 --- a/src/types/events/guild.rs +++ b/src/types/events/guild.rs @@ -80,12 +80,23 @@ impl UpdateMessage for GuildUpdate { } } -#[derive(Debug, Default, Deserialize, Serialize, Clone)] +#[derive(Debug, Default, Deserialize, Serialize, Clone, SourceUrlField, JsonField)] /// See ; /// Received to tell the client about a guild being deleted; pub struct GuildDelete { #[serde(flatten)] pub guild: UnavailableGuild, + #[serde(skip)] + pub source_url: String, + #[serde(skip)] + pub json: String, +} + +impl UpdateMessage for GuildDelete { + fn id(&self) -> Option { + Some(self.guild.id) + } + fn update(&mut self, _: Arc>) {} } impl WebSocketEvent for GuildDelete {}