pub struct Channel {
pub id: Option<Snowflake>,
pub guild_id: Option<Snowflake>,
pub name: Option<String>,
pub channel_type: Option<ChannelType>,
pub sub_type: Option<ChannelSubType>,
pub position: Option<i32>,
pub parent_id: Option<Snowflake>,
pub owner_id: Option<Snowflake>,
pub private_type: Option<PrivateType>,
pub speak_permission: Option<SpeakPermission>,
pub application_id: Option<Snowflake>,
pub permissions: Option<String>,
}Expand description
Represents a channel in a guild.
Fields§
§id: Option<Snowflake>The channel’s unique ID
guild_id: Option<Snowflake>The guild ID this channel belongs to
name: Option<String>The channel’s name
channel_type: Option<ChannelType>The type of channel
sub_type: Option<ChannelSubType>The subtype of channel
position: Option<i32>The position of this channel in the channel list
parent_id: Option<Snowflake>The ID of the parent category
owner_id: Option<Snowflake>The ID of the channel owner
private_type: Option<PrivateType>The private type of the channel
speak_permission: Option<SpeakPermission>The speak permission setting
application_id: Option<Snowflake>The application ID for application channels
permissions: Option<String>The permissions string
Implementations§
Source§impl Channel
impl Channel
Sourcepub fn from_data(_api: BotApi, id: String, data: Value) -> Self
pub fn from_data(_api: BotApi, id: String, data: Value) -> Self
Creates a new channel from API data.
Sourcepub fn is_application(&self) -> bool
pub fn is_application(&self) -> bool
Returns true if this is an application channel.
Sourcepub fn is_discussion(&self) -> bool
pub fn is_discussion(&self) -> bool
Returns true if this is a discussion (forum) channel.
Sourcepub fn is_admin_only(&self) -> bool
pub fn is_admin_only(&self) -> bool
Returns true if the channel is private (admin only).
Sourcepub fn is_specified_users_only(&self) -> bool
pub fn is_specified_users_only(&self) -> bool
Returns true if the channel is for specified users only.
Sourcepub fn everyone_can_speak(&self) -> bool
pub fn everyone_can_speak(&self) -> bool
Returns true if everyone can speak in this channel.
Sourcepub fn admin_only_speak(&self) -> bool
pub fn admin_only_speak(&self) -> bool
Returns true if only admins can speak in this channel.
Sourcepub fn display_name(&self) -> Option<&str>
pub fn display_name(&self) -> Option<&str>
Gets the channel’s display name (same as name for channels).