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
sourceimpl<'a> CreateGuildChannel<'a>
impl<'a> CreateGuildChannel<'a>
sourcepub const fn bitrate(self, bitrate: u32) -> Self
pub const fn bitrate(self, bitrate: u32) -> Self
For voice and stage channels, set the bitrate of the channel.
Must be at least 8000.
sourcepub const fn default_auto_archive_duration(
self,
auto_archive_duration: AutoArchiveDuration
) -> Self
pub const 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.
sourcepub const fn kind(self, kind: ChannelType) -> Self
pub const fn kind(self, kind: ChannelType) -> Self
Set the kind of channel.
sourcepub const fn parent_id(self, parent_id: Id<ChannelMarker>) -> Self
pub const 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.
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.
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 name is
invalid.
sourcepub const fn rtc_region(self, rtc_region: &'a str) -> Self
pub const fn rtc_region(self, rtc_region: &'a str) -> Self
For voice and stage channels, set the channel’s RTC region.
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 name is
invalid.
sourcepub const fn user_limit(self, user_limit: u16) -> Self
pub const 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.
sourcepub const fn video_quality_mode(
self,
video_quality_mode: VideoQualityMode
) -> Self
pub const fn video_quality_mode(
self,
video_quality_mode: VideoQualityMode
) -> Self
For voice channels, set the channel’s video quality mode.
sourcepub fn exec(self) -> ResponseFuture<Channel>ⓘNotable traits for ResponseFuture<T>impl<T: Unpin> Future for ResponseFuture<T> type Output = Result<Response<T>, Error>;
pub fn exec(self) -> ResponseFuture<Channel>ⓘNotable traits for ResponseFuture<T>impl<T: Unpin> Future for ResponseFuture<T> type Output = Result<Response<T>, Error>;
Execute the request, returning a future resolving to a Response
.
Trait Implementations
sourceimpl<'a> AuditLogReason<'a> for CreateGuildChannel<'a>
impl<'a> AuditLogReason<'a> for CreateGuildChannel<'a>
sourceimpl TryIntoRequest for CreateGuildChannel<'_>
impl TryIntoRequest for CreateGuildChannel<'_>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more