Skip to content

Commit

Permalink
Implement UpdateMessage for GuildDelete
Browse files Browse the repository at this point in the history
  • Loading branch information
bitfl0wer committed Sep 5, 2023
1 parent 43f1aa1 commit b3bbff5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/types/events/guild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
/// 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<Guild> for GuildDelete {
fn id(&self) -> Option<Snowflake> {
Some(self.guild.id)
}
fn update(&mut self, _: Arc<RwLock<Guild>>) {}
}

impl WebSocketEvent for GuildDelete {}
Expand Down

0 comments on commit b3bbff5

Please sign in to comment.