Struct discord_flows::model::GuildChannel
source · pub struct GuildChannel {Show 29 fields
pub id: ChannelId,
pub bitrate: Option<u64>,
pub parent_id: Option<ChannelId>,
pub guild_id: GuildId,
pub kind: ChannelType,
pub owner_id: Option<UserId>,
pub last_message_id: Option<MessageId>,
pub last_pin_timestamp: Option<Timestamp>,
pub name: String,
pub permission_overwrites: Vec<PermissionOverwrite, Global>,
pub position: i64,
pub topic: Option<String>,
pub user_limit: Option<u64>,
pub nsfw: bool,
pub rate_limit_per_user: Option<u64>,
pub rtc_region: Option<String>,
pub video_quality_mode: Option<VideoQualityMode>,
pub message_count: Option<u8>,
pub member_count: Option<u8>,
pub thread_metadata: Option<ThreadMetadata>,
pub member: Option<ThreadMember>,
pub default_auto_archive_duration: Option<u64>,
pub flags: ChannelFlags,
pub total_message_sent: Option<u64>,
pub available_tags: Vec<ForumTag, Global>,
pub applied_tags: Vec<ForumTagId, Global>,
pub default_reaction_emoji: Option<DefaultReaction>,
pub default_thread_rate_limit_per_user: Option<u64>,
pub default_sort_order: Option<SortOrder>,
}
Expand description
Represents a guild’s text, news, or voice channel. Some methods are available
only for voice channels and some are only available for text channels.
News channels are a subset of text channels and lack slow mode hence
Self::rate_limit_per_user
will be None
.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.id: ChannelId
The unique Id of the channel.
bitrate: Option<u64>
The bitrate of the channel.
Note: This is only available for voice and stage channels.
parent_id: Option<ChannelId>
The Id of the parent category for a channel, or of the parent text channel for a thread.
Note: This is only available for channels in a category and thread channels.
guild_id: GuildId
The Id of the guild the channel is located in.
The original voice channel has an Id equal to the guild’s Id, incremented by one.
kind: ChannelType
The type of the channel.
owner_id: Option<UserId>
The Id of the user who created this channel
Note: This is only available for threads and forum posts
last_message_id: Option<MessageId>
The Id of the last message sent in the channel.
Note: This is only available for text channels.
last_pin_timestamp: Option<Timestamp>
The timestamp of the time a pin was most recently made.
Note: This is only available for text channels.
name: String
The name of the channel.
permission_overwrites: Vec<PermissionOverwrite, Global>
§position: i64
The position of the channel.
The default text channel will almost always have a position of -1
or
0
.
topic: Option<String>
The topic of the channel.
Note: This is only available for text, forum and stage channels.
user_limit: Option<u64>
The maximum number of members allowed in the channel.
Note: This is only available for voice channels.
nsfw: bool
Used to tell if the channel is not safe for work.
Note however, it’s recommended to use [Self::is_nsfw
] as it’s gonna be more accurate.
rate_limit_per_user: Option<u64>
A rate limit that applies per user and excludes bots.
Note: This is only available for text channels excluding news channels.
rtc_region: Option<String>
The region override.
Note: This is only available for voice and stage channels. None
for voice and stage channels means automatic region selection.
video_quality_mode: Option<VideoQualityMode>
The video quality mode for a voice channel.
message_count: Option<u8>
An approximate count of messages in the thread.
This is currently saturated at 255 to prevent breaking.
Note: This is only available on thread channels.
member_count: Option<u8>
An approximate count of users in a thread, stops counting at 50.
Note: This is only available on thread channels.
thread_metadata: Option<ThreadMetadata>
The thread metadata.
Note: This is only available on thread channels.
member: Option<ThreadMember>
Thread member object for the current user, if they have joined the thread, only included on certain API endpoints.
default_auto_archive_duration: Option<u64>
Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity.
Note: It can currently only be set to 60, 1440, 4320, 10080.
flags: ChannelFlags
Extra information about the channel
Note: This is only available in forum channels.
total_message_sent: Option<u64>
The number of messages ever sent in a thread, it’s similar to message_count
on message creation, but will not decrement the number when a message is deleted.
The set of available tags.
Note: This is only available in forum channels.
The set of applied tags.
Note: This is only available in a thread in a forum.
default_reaction_emoji: Option<DefaultReaction>
The emoji to show in the add reaction button
Note: This is only available in a forum.
default_thread_rate_limit_per_user: Option<u64>
The initial rate_limit_per_user
to set on newly created threads in a channel.
This field is copied to the thread at creation time and does not live update.
Note: This is only available in a forum or text channel.
default_sort_order: Option<SortOrder>
The default sort order type used to order posts
Note: This is only available in a forum.
Trait Implementations§
source§impl Clone for GuildChannel
impl Clone for GuildChannel
source§fn clone(&self) -> GuildChannel
fn clone(&self) -> GuildChannel
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GuildChannel
impl Debug for GuildChannel
source§impl<'de> Deserialize<'de> for GuildChannel
impl<'de> Deserialize<'de> for GuildChannel
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<GuildChannel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<GuildChannel, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§impl Display for GuildChannel
impl Display for GuildChannel
source§impl<'a> From<&'a GuildChannel> for ChannelId
impl<'a> From<&'a GuildChannel> for ChannelId
source§fn from(public_channel: &GuildChannel) -> ChannelId
fn from(public_channel: &GuildChannel) -> ChannelId
Gets the Id of a guild channel.
source§impl From<GuildChannel> for ChannelId
impl From<GuildChannel> for ChannelId
source§fn from(public_channel: GuildChannel) -> ChannelId
fn from(public_channel: GuildChannel) -> ChannelId
Gets the Id of a guild channel.