Struct twilight_http::request::guild::CreateGuildChannel

source ·
pub struct CreateGuildChannel<'a> { /* private fields */ }
Expand description

Create a new request to create a guild channel.

All fields are optional except for name. The minimum length of the name is 1 UTF-16 characters and the maximum is 100 UTF-16 characters.

Implementations§

source§

impl<'a> CreateGuildChannel<'a>

source

pub fn available_tags(self, available_tags: &'a [ForumTag]) -> Self

Set the available tags for the forum.

source

pub fn bitrate(self, bitrate: u32) -> Self

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.

source

pub fn default_auto_archive_duration( self, auto_archive_duration: AutoArchiveDuration ) -> Self

Set the default auto archive duration for newly created threads in the channel.

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

source

pub fn default_forum_layout(self, default_forum_layout: ForumLayout) -> Self

Set the default forum layout for new forum channels.

source

pub fn default_reaction_emoji( self, default_reaction_emoji: &'a DefaultReaction ) -> Self

Set the default reaction emoji for new forum threads.

source

pub fn default_sort_order(self, default_sort_order: ForumSortOrder) -> Self

Set the default sort order for newly created forum channels.

source

pub fn default_thread_rate_limit_per_user( self, default_thread_rate_limit_per_user: u16 ) -> Self

Set the default number of seconds that a user must wait before before they are able to send another message in any newly-created thread in the channel.

This field is only applicable for text, announcement, media, and forum channels. The minimum is 0 and the maximum is 21600. This is also known as “Slow Mode”. See Discord Docs/Channel Object.

source

pub fn kind(self, kind: ChannelType) -> Self

Set the kind of channel.

source

pub fn nsfw(self, nsfw: bool) -> Self

Set whether the channel is marked as NSFW.

source

pub fn parent_id(self, parent_id: Id<ChannelMarker>) -> Self

If this is specified, and the parent ID is a ChannelType::CategoryChannel, create this channel as a child of the category channel.

source

pub fn permission_overwrites( self, permission_overwrites: &'a [PermissionOverwrite] ) -> Self

Set the permission overwrites of a channel.

source

pub 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.

source

pub fn rate_limit_per_user(self, rate_limit_per_user: u16) -> Self

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 name is invalid.

source

pub fn rtc_region(self, rtc_region: &'a str) -> Self

For voice and stage channels, set the channel’s RTC region.

source

pub fn topic(self, topic: &'a str) -> Self

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 name is invalid.

source

pub fn user_limit(self, user_limit: u16) -> Self

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 for more details.

source

pub fn video_quality_mode(self, video_quality_mode: VideoQualityMode) -> Self

For voice channels, set the channel’s video quality mode.

Trait Implementations§

source§

impl<'a> AuditLogReason<'a> for CreateGuildChannel<'a>

source§

fn reason(self, reason: &'a str) -> Self

Attach an audit log reason to the request. Read more
source§

impl IntoFuture for CreateGuildChannel<'_>

§

type Output = Result<Response<Channel>, Error>

The output that the future will produce on completion.
§

type IntoFuture = ResponseFuture<Channel>

Which kind of future are we turning this into?
source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more
source§

impl TryIntoRequest for CreateGuildChannel<'_>

source§

fn try_into_request(self) -> Result<Request, Error>

Try to convert a request builder into a raw Request. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for CreateGuildChannel<'a>

§

impl<'a> !RefUnwindSafe for CreateGuildChannel<'a>

§

impl<'a> Send for CreateGuildChannel<'a>

§

impl<'a> Sync for CreateGuildChannel<'a>

§

impl<'a> Unpin for CreateGuildChannel<'a>

§

impl<'a> !UnwindSafe for CreateGuildChannel<'a>

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.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more