Struct twilight_http::request::channel::UpdateChannel
source · pub struct UpdateChannel<'a> { /* private fields */ }
Expand description
Update a channel.
All fields are optional. The minimum length of the name is 1 UTF-16 character and the maximum is 100 UTF-16 characters.
Implementations§
source§impl<'a> UpdateChannel<'a>
impl<'a> UpdateChannel<'a>
Set the available tags for the forum.
sourcepub const fn bitrate(self, bitrate: u32) -> Result<Self, ChannelValidationError>
pub const fn bitrate(self, bitrate: u32) -> Result<Self, ChannelValidationError>
For voice and stage channels, set the bitrate of the channel.
Must be at least 8000.
Errors
Returns an error of type BitrateInvalid
if the bitrate is invalid.
sourcepub const fn default_forum_layout(
self,
default_forum_layout: ForumLayout
) -> Self
pub const fn default_forum_layout( self, default_forum_layout: ForumLayout ) -> Self
Set the default layout for forum channels.
sourcepub const fn default_reaction_emoji(
self,
default_reaction_emoji: Option<&'a DefaultReaction>
) -> Self
pub const fn default_reaction_emoji( self, default_reaction_emoji: Option<&'a DefaultReaction> ) -> Self
Set the default reaction emoji for new forum threads.
sourcepub const fn default_sort_order(
self,
default_sort_order: Option<ForumSortOrder>
) -> Self
pub const fn default_sort_order( self, default_sort_order: Option<ForumSortOrder> ) -> Self
Set the default sort order for forum channels.
sourcepub const fn default_thread_rate_limit_per_user(
self,
default_thread_rate_limit_per_user: Option<u16>
) -> Result<Self, ChannelValidationError>
pub const fn default_thread_rate_limit_per_user( self, default_thread_rate_limit_per_user: Option<u16> ) -> Result<Self, ChannelValidationError>
Set the default number of seconds that a user must wait before before they are able to send another message in new forum threads.
The minimum is 0 and the maximum is 21600. This is also known as “Slow Mode”. See Discord Docs/Channel Object.
Errors
Returns an error of type RateLimitPerUserInvalid
if the limit is
invalid.
sourcepub const fn flags(self, flags: ChannelFlags) -> Self
pub const fn flags(self, flags: ChannelFlags) -> Self
Set the flags of the channel, if supported.
sourcepub fn forum_topic(
self,
topic: Option<&'a str>
) -> Result<Self, ChannelValidationError>
pub fn forum_topic( self, topic: Option<&'a str> ) -> Result<Self, ChannelValidationError>
Set the forum topic.
The maximum length is 4096 UTF-16 characters. See Discord Docs/Channel Object.
Errors
Returns an error of type ForumTopicInvalid
if the channel type is
GuildForum
and the topic is invalid.
sourcepub fn name(self, name: &'a str) -> Result<Self, ChannelValidationError>
pub fn name(self, name: &'a str) -> Result<Self, ChannelValidationError>
Set the name.
The minimum length is 1 UTF-16 character and the maximum is 100 UTF-16 characters.
Errors
Returns an error of type NameInvalid
if the name is invalid.
sourcepub const fn parent_id(self, parent_id: Option<Id<ChannelMarker>>) -> Self
pub const fn parent_id(self, parent_id: Option<Id<ChannelMarker>>) -> Self
If this is specified, and the parent ID is a ChannelType::CategoryChannel
, move this
channel to a child of the category channel.
sourcepub const fn permission_overwrites(
self,
permission_overwrites: &'a [PermissionOverwrite]
) -> Self
pub const fn permission_overwrites( self, permission_overwrites: &'a [PermissionOverwrite] ) -> Self
Set the permission overwrites of a channel. This will overwrite all permissions that the channel currently has, so use with caution!
sourcepub const fn position(self, position: u64) -> Self
pub const fn position(self, position: u64) -> Self
Set the position of the channel.
Positions are numerical and zero-indexed. If you place a channel at position 2, channels 2-n will shift down one position and the initial channel will take its place.
sourcepub const fn rate_limit_per_user(
self,
rate_limit_per_user: u16
) -> Result<Self, ChannelValidationError>
pub const fn rate_limit_per_user( self, rate_limit_per_user: u16 ) -> Result<Self, ChannelValidationError>
Set the number of seconds that a user must wait before before they are able to send another message.
The minimum is 0 and the maximum is 21600. This is also known as “Slow Mode”. See Discord Docs/Channel Object.
Errors
Returns an error of type RateLimitPerUserInvalid
if the limit is
invalid.
sourcepub const fn rtc_region(self, rtc_region: Option<&'a str>) -> Self
pub const fn rtc_region(self, rtc_region: Option<&'a str>) -> Self
For voice and stage channels, set the channel’s RTC region.
Set to None
to clear.
sourcepub fn topic(self, topic: &'a str) -> Result<Self, ChannelValidationError>
pub fn topic(self, topic: &'a str) -> Result<Self, ChannelValidationError>
Set the topic.
The maximum length is 1024 UTF-16 characters. See Discord Docs/Channel Object.
Errors
Returns an error of type TopicInvalid
if the topic is invalid.
sourcepub fn user_limit(self, user_limit: u16) -> Result<Self, ChannelValidationError>
pub fn user_limit(self, user_limit: u16) -> Result<Self, ChannelValidationError>
For voice channels, set the user limit.
Set to 0 for no limit. Limit can otherwise be between 1 and 99 inclusive. See Discord Docs/Modify Channel.
Errors
Returns an error of type UserLimitInvalid
if the bitrate is invalid.
sourcepub const fn video_quality_mode(
self,
video_quality_mode: VideoQualityMode
) -> Self
pub const fn video_quality_mode( self, video_quality_mode: VideoQualityMode ) -> Self
Set the VideoQualityMode
for the voice channel.
sourcepub const fn kind(self, kind: ChannelType) -> Self
pub const fn kind(self, kind: ChannelType) -> Self
Set the kind of channel.
Only conversion between ChannelType::GuildText
and
ChannelType::GuildAnnouncement
is possible, and only if the guild has the
NEWS
feature enabled. See Discord Docs/Modify Channel.