diff --git a/src/api/types.rs b/src/api/types.rs index 5631130..e5cc3de 100644 --- a/src/api/types.rs +++ b/src/api/types.rs @@ -544,7 +544,7 @@ struct ChannelMention { id: String, guild_id: String, #[serde(rename = "type")] - channel_type: i32, + channel_type: ChannelType, name: String, } @@ -742,7 +742,7 @@ pub struct GuildMember { pub struct Channel { pub id: String, #[serde(rename = "type")] - pub channel_type: i32, + pub channel_type: ChannelType, pub guild_id: Option, pub position: Option, pub permission_overwrites: Option>, @@ -1480,3 +1480,21 @@ pub struct Webhook { pub struct GuildCreateResponse { pub id: String, } + +#[derive(Serialize, Deserialize, Debug, Default, Clone)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum ChannelType { + #[default] + GuildText = 0, + DM = 1, + GuildVoice = 2, + GroupDM = 3, + GuildCategory = 4, + GuildAnnouncement = 5, + AnnouncementThread = 10, + PublicThread = 11, + PrivateThread = 12, + GuildStageVoice = 13, + GuildDirectory = 14, + GuildForum = 15, +}