Skip to main content

ModifyGuildChannel

Struct ModifyGuildChannel 

Source
#[non_exhaustive]
pub struct ModifyGuildChannel {
Show 19 fields pub name: Option<CompactString>, pub kind: Option<ChannelType>, pub position: Patch<i32>, pub topic: Patch<CompactString>, pub nsfw: Patch<bool>, pub rate_limit_per_user: Patch<u16>, pub bitrate: Patch<u32>, pub user_limit: Patch<u32>, pub permission_overwrites: Patch<Vec<Overwrite>>, pub parent_id: Patch<ChannelId>, pub rtc_region: Patch<CompactString>, pub video_quality_mode: Patch<VideoQualityMode>, pub default_auto_archive_duration: Patch<AutoArchiveDuration>, pub flags: Option<ChannelFlags>, pub available_tags: Option<Vec<ForumTagData>>, pub default_reaction_emoji: Patch<DefaultReaction>, pub default_thread_rate_limit_per_user: Option<u16>, pub default_sort_order: Patch<SortOrderType>, pub default_forum_layout: Option<ForumLayoutType>,
}
Expand description

The body of Modify Channel for a guild channel (D-109).

Every field is optional; Patch fields can also be cleared. Which fields apply depends on the channel’s type (e.g. bitrate only for voice and stage channels).

discord.js counterpart: GuildChannelEditOptions.

§Examples

use djs_model::{rest::ModifyGuildChannel, util::Patch};

let mut body = ModifyGuildChannel::default();
body.name = Some("general".into());
body.topic = Patch::Clear;
assert_eq!(serde_json::to_string(&body).unwrap(), r#"{"name":"general","topic":null}"#);

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: Option<CompactString>

The name (1-100 characters).

§kind: Option<ChannelType>

The new type; only text ↔ announcement, in guilds with the NEWS feature.

§position: Patch<i32>

The position in the channel list (channels with the same position are sorted by ID).

§topic: Patch<CompactString>

The topic (0-1024 characters, 0-4096 for forum and media channels).

§nsfw: Patch<bool>

Whether the channel is age-restricted.

§rate_limit_per_user: Patch<u16>

Slowmode: seconds a member must wait between messages (0-21600).

§bitrate: Patch<u32>

The bitrate of a voice or stage channel, in bits per second (min 8000; the maximum depends on the guild’s boost level).

§user_limit: Patch<u32>

The user limit of a voice (max 99) or stage (max 10 000) channel; 0 is no limit.

§permission_overwrites: Patch<Vec<Overwrite>>

The permission overwrites (all of them; needs MANAGE_ROLES).

§parent_id: Patch<ChannelId>

The parent category.

§rtc_region: Patch<CompactString>

The voice region ID; Patch::Clear selects it automatically.

§video_quality_mode: Patch<VideoQualityMode>

The camera video quality of a voice or stage channel.

§default_auto_archive_duration: Patch<AutoArchiveDuration>

The archive duration that clients preselect for new threads.

§flags: Option<ChannelFlags>

The channel’s flags.

§available_tags: Option<Vec<ForumTagData>>

The tags of a forum or media channel (max 20); tags without an ID are created.

§default_reaction_emoji: Patch<DefaultReaction>

The emoji of the add-reaction button on posts of a forum or media channel.

§default_thread_rate_limit_per_user: Option<u16>

The slowmode copied to new threads.

§default_sort_order: Patch<SortOrderType>

The default order of posts in a forum or media channel.

§default_forum_layout: Option<ForumLayoutType>

The default layout of a forum channel.

Trait Implementations§

Source§

impl Clone for ModifyGuildChannel

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ModifyGuildChannel

Source§

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

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

impl Default for ModifyGuildChannel

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for ModifyGuildChannel

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for ModifyGuildChannel

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 StructuralPartialEq for ModifyGuildChannel

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.