pub struct Channel {
Show 35 fields pub application_id: Option<Id<ApplicationMarker>>, pub applied_tags: Option<Vec<Id<TagMarker>>>, pub available_tags: Option<Vec<ForumTag>>, pub bitrate: Option<u32>, pub default_auto_archive_duration: Option<AutoArchiveDuration>, pub default_forum_layout: Option<ForumLayout>, pub default_reaction_emoji: Option<DefaultReaction>, pub default_sort_order: Option<ForumSortOrder>, pub default_thread_rate_limit_per_user: Option<u16>, pub flags: Option<ChannelFlags>, pub guild_id: Option<Id<GuildMarker>>, pub icon: Option<ImageHash>, pub id: Id<ChannelMarker>, pub invitable: Option<bool>, pub kind: ChannelType, pub last_message_id: Option<Id<GenericMarker>>, pub last_pin_timestamp: Option<Timestamp>, pub managed: Option<bool>, pub member: Option<ThreadMember>, pub member_count: Option<i8>, pub message_count: Option<u32>, pub name: Option<String>, pub newly_created: Option<bool>, pub nsfw: Option<bool>, pub owner_id: Option<Id<UserMarker>>, pub parent_id: Option<Id<ChannelMarker>>, pub permission_overwrites: Option<Vec<PermissionOverwrite>>, pub position: Option<i32>, pub rate_limit_per_user: Option<u16>, pub recipients: Option<Vec<User>>, pub rtc_region: Option<String>, pub thread_metadata: Option<ThreadMetadata>, pub topic: Option<String>, pub user_limit: Option<u32>, pub video_quality_mode: Option<VideoQualityMode>,
}
Expand description

Channel to send messages in, call with other users, organize groups, and more.

The Channel type is one overarching type for all types of channels: there is no distinction between audio channels, textual channels, guild channels, groups, threads, and so on. The type of channel can be determined by checking Channel::kind, which can be used to determine what fields you might expect to be present.

For Discord’s documentation on channels, refer to Discord Docs/Channel.

Fields§

§application_id: Option<Id<ApplicationMarker>>

ID of the application that created the channel.

§applied_tags: Option<Vec<Id<TagMarker>>>§available_tags: Option<Vec<ForumTag>>§bitrate: Option<u32>

Bitrate (in bits) setting of audio channels.

§default_auto_archive_duration: Option<AutoArchiveDuration>

Default duration without messages before the channel’s threads automatically archive.

Automatic archive durations are not locked behind the guild’s boost level.

§default_forum_layout: Option<ForumLayout>

Default forum layout view used to display posts in forum channels.

§default_reaction_emoji: Option<DefaultReaction>§default_sort_order: Option<ForumSortOrder>

Default sort order used to display posts in forum channels.

§default_thread_rate_limit_per_user: Option<u16>§flags: Option<ChannelFlags>

Flags of the channel.

§guild_id: Option<Id<GuildMarker>>

ID of the guild the channel is in.

§icon: Option<ImageHash>

Hash of the channel’s icon.

§id: Id<ChannelMarker>

ID of the channel.

§invitable: Option<bool>

Whether users can be invited.

§kind: ChannelType

Type of the channel.

This can be used to determine what fields might be available.

§last_message_id: Option<Id<GenericMarker>>

For text channels, this is the ID of the last message sent in the channel.

For forum channels, this is the ID of the last created thread in the forum.

§last_pin_timestamp: Option<Timestamp>

ID of the last message pinned in the channel.

§managed: Option<bool>

Whether the channel is managed by an application via the gdm.join oauth scope.

This is only applicable to group channels.

§member: Option<ThreadMember>

Member that created the channel.

§member_count: Option<i8>

Number of members in the channel.

At most a value of 50 is provided although the real number may be higher.

§message_count: Option<u32>

Number of messages in the channel.

§name: Option<String>

Name of the channel.

§newly_created: Option<bool>

Whether a thread was newly created.

§nsfw: Option<bool>

Whether the channel has been configured to be NSFW.

§owner_id: Option<Id<UserMarker>>

ID of the creator of the channel.

§parent_id: Option<Id<ChannelMarker>>

ID of the parent channel.

For guild channels this is the ID of the parent category channel.

For threads this is the ID of the channel the thread was created in.

§permission_overwrites: Option<Vec<PermissionOverwrite>>

Explicit permission overwrites for members and roles.

§position: Option<i32>

Sorting position of the channel.

§rate_limit_per_user: Option<u16>

Amount of seconds a user has to wait before sending another message.

§recipients: Option<Vec<User>>

Recipients of the channel.

§rtc_region: Option<String>

ID of the voice region for the channel.

Defaults to automatic for applicable channels.

§thread_metadata: Option<ThreadMetadata>

Metadata about a thread.

§topic: Option<String>

Topic of the channel.

§user_limit: Option<u32>

Number of users that may be in the channel.

Zero refers to no limit.

§video_quality_mode: Option<VideoQualityMode>

Camera video quality mode of the channel.

Defaults to VideoQualityMode::Auto for applicable channels.

Trait Implementations§

source§

impl Clone for Channel

source§

fn clone(&self) -> Channel

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Channel

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Channel

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Hash for Channel

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for Channel

source§

fn eq(&self, other: &Channel) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Channel

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Channel

source§

impl StructuralPartialEq for Channel

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,