Add ChannelType enum

This commit is contained in:
bitfl0wer 2023-05-23 14:50:48 +02:00
parent 912d8043d0
commit b293f5ed96
1 changed files with 20 additions and 2 deletions

View File

@ -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<String>,
pub position: Option<i32>,
pub permission_overwrites: Option<Vec<PermissionOverwrite>>,
@ -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,
}