diff options
Diffstat (limited to 'src/model/gateway.rs')
| -rw-r--r-- | src/model/gateway.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/model/gateway.rs b/src/model/gateway.rs index 60c9566..5748302 100644 --- a/src/model/gateway.rs +++ b/src/model/gateway.rs @@ -302,6 +302,12 @@ pub struct VoiceStateUpdateEvent { pub voice_state: VoiceState, } +#[derive(Clone, Debug)] +pub struct WebhookUpdateEvent { + pub channel_id: ChannelId, + pub guild_id: GuildId, +} + #[derive(Debug, Clone)] pub enum GatewayEvent { Dispatch(u64, Event), @@ -483,6 +489,11 @@ pub enum Event { VoiceStateUpdate(VoiceStateUpdateEvent), /// Voice server information is available VoiceServerUpdate(VoiceServerUpdateEvent), + /// A webhook for a [channel][`PublicChannel`] was updated in a [`Guild`]. + /// + /// [`Guild`]: struct.Guild.html + /// [`PublicChannel`]: struct.PublicChannel.html + WebhookUpdate(WebhookUpdateEvent), /// An event type not covered by the above Unknown(UnknownEvent), } @@ -748,6 +759,11 @@ impl Event { guild_id: try!(opt(&mut value, "guild_id", GuildId::decode)), voice_state: try!(VoiceState::decode(Value::Object(value))), })) + } else if kind == "WEBHOOKS_UPDATE" { + Ok(Event::WebhookUpdate(WebhookUpdateEvent { + channel_id: try!(remove(&mut value, "channel_id").and_then(ChannelId::decode)), + guild_id: try!(remove(&mut value, "guild_id").and_then(GuildId::decode)), + })) } else { Ok(Event::Unknown(UnknownEvent { kind: kind, |