#[non_exhaustive]pub enum ChannelType {
Show 14 variants
GuildText,
Dm,
GuildVoice,
GroupDm,
GuildCategory,
GuildAnnouncement,
AnnouncementThread,
PublicThread,
PrivateThread,
GuildStageVoice,
GuildDirectory,
GuildForum,
GuildMedia,
Unknown(u8),
}Expand description
The type of a channel.
discord.js counterpart: ChannelType.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
GuildText
A text channel in a guild.
Dm
A direct message between two users.
GuildVoice
A voice channel in a guild.
GroupDm
A direct message between several users.
GuildCategory
A category that organizes up to 50 channels.
GuildAnnouncement
A channel that users can follow and crosspost into their own guild.
AnnouncementThread
A thread in an announcement channel.
PublicThread
A public thread in a text, forum or media channel.
PrivateThread
A private thread in a text channel, visible to invited members and moderators.
GuildStageVoice
A voice channel for hosting events with an audience.
GuildDirectory
The channel of a Student Hub listing its servers.
GuildForum
A channel that can only contain threads.
GuildMedia
A channel that can only contain threads, for media posts.
Unknown(u8)
A value that this version of the library does not know about.
Discord may add new values at any time. They are preserved here so that no
information is lost and deserialization never fails because of them. Prefer
ChannelType::from over constructing this variant directly.
Implementations§
Source§impl ChannelType
impl ChannelType
Sourcepub const fn value(self) -> u8
pub const fn value(self) -> u8
Returns the raw integer value Discord uses for this variant.
discord.js counterpart: the enum’s numeric value in discord-api-types.
Sourcepub const fn is_unknown(self) -> bool
pub const fn is_unknown(self) -> bool
Returns true if this is a value the library does not know about.
discord.js counterpart: none (discord.js passes unknown numbers through).
Sourcepub const fn from_value(value: u8) -> Self
pub const fn from_value(value: u8) -> Self
Converts a raw value into the matching variant, or Self::Unknown.
discord.js counterpart: none (discord.js passes unknown numbers through).