polyphony_types/events/
channel.rs

1use chrono::{DateTime, Utc};
2use serde::{Deserialize, Serialize};
3use crate::entities::Channel;
4use crate::events::WebSocketEvent;
5
6#[derive(Debug, Default, Deserialize, Serialize)]
7/// See https://discord.com/developers/docs/topics/gateway-events#channel-pins-update
8pub struct ChannelPinsUpdate {
9    pub guild_id: Option<String>,
10    pub channel_id: String,
11    pub last_pin_timestamp: Option<DateTime<Utc>>,
12}
13
14impl WebSocketEvent for ChannelPinsUpdate {}
15
16#[derive(Debug, Default, Deserialize, Serialize)]
17/// See https://discord.com/developers/docs/topics/gateway-events#channel-create
18/// Not directly serialized, as the inner payload is a channel object
19pub struct ChannelCreate {
20    pub channel: Channel,
21}
22
23impl WebSocketEvent for ChannelCreate {}
24
25#[derive(Debug, Default, Deserialize, Serialize)]
26/// See https://discord.com/developers/docs/topics/gateway-events#channel-update
27/// Not directly serialized, as the inner payload is a channel object
28pub struct ChannelUpdate {
29    pub channel: Channel,
30}
31
32impl WebSocketEvent for ChannelUpdate {}
33
34#[derive(Debug, Default, Deserialize, Serialize)]
35/// See https://discord.com/developers/docs/topics/gateway-events#channel-delete
36/// Not directly serialized, as the inner payload is a channel object
37pub struct ChannelDelete {
38    pub channel: Channel,
39}
40
41impl WebSocketEvent for ChannelDelete {}