[][src]Struct twilight_http::request::channel::update_channel::UpdateChannel

pub struct UpdateChannel<'a> { /* fields omitted */ }

Update a channel.

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

Errors

Returns a UpdateChannelError::NameInvalid when the length of the name is either fewer than 2 UTF-16 characters or more than 100 UTF-16 characters.

Returns a UpdateChannelError::RateLimitPerUserInvalid when the seconds of the rate limit per user is more than 21600.

Returns a UpdateChannelError::TopicInvalid when the length of the topic is more than 1024 UTF-16 characters.

Implementations

impl<'a> UpdateChannel<'a>[src]

pub fn bitrate(mut self: Self, bitrate: u64) -> Self[src]

Set the bitrate of the channel. Applicable to voice channels only.

pub fn name(self, name: impl Into<String>) -> Result<Self, UpdateChannelError>[src]

Set the name.

The minimum length is 2 UTF-16 characters and the maximum is 100 UTF-16 characters.

Errors

Returns UpdateChannelError::NameInvalid if the name length is too short or too long.

pub fn nsfw(mut self: Self, nsfw: bool) -> Self[src]

Set whether the channel is marked as NSFW.

pub fn parent_id(
    mut self: Self,
    parent_id: impl Into<Option<ChannelId>>
) -> Self
[src]

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

pub fn permission_overwrites(
    mut self: Self,
    permission_overwrites: Vec<PermissionOverwrite>
) -> Self
[src]

Set the permission overwrites of a channel. This will overwrite all permissions that the channel currently has, so use with caution!

pub fn position(mut self: Self, position: u64) -> Self[src]

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.

pub fn rate_limit_per_user(
    mut self: Self,
    rate_limit_per_user: u64
) -> Result<Self, UpdateChannelError>
[src]

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. Refer to the discord docs for more details. This is also known as "Slow Mode".

Errors

Returns UpdateChannelError::RateLimitPerUserInvalid if the amount is greater than 21600.

pub fn topic(self, topic: impl Into<String>) -> Result<Self, UpdateChannelError>[src]

Set the topic.

The maximum length is 1024 UTF-16 characters. Refer to the discord docs for more details.

Errors

Returns UpdateChannelError::TopicInvalid if the topic length is too long.

pub fn user_limit(mut self: Self, user_limit: u64) -> Self[src]

For voice channels, set the user limit.

Set to 0 for no limit. Limit can otherwise be between 1 and 99 inclusive. Refer to the discord docs for more details.

pub fn kind(mut self: Self, kind: ChannelType) -> Self[src]

Set the kind of channel.

Only conversion between ChannelType::GuildText and ChannelType::GuildNews is possible, and only if the guild has the NEWS feature enabled. Refer to the discord docs for more details.

Trait Implementations

impl<'a> AuditLogReason for UpdateChannel<'a>[src]

impl Future for UpdateChannel<'_>[src]

type Output = Result<Channel>

The type of value produced on completion.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for UpdateChannel<'a>[src]

impl<'a> Send for UpdateChannel<'a>[src]

impl<'a> !Sync for UpdateChannel<'a>[src]

impl<'a> Unpin for UpdateChannel<'a>[src]

impl<'a> !UnwindSafe for UpdateChannel<'a>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FutureExt for T where
    T: Future + ?Sized
[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F> IntoFuture for F where
    F: Future
[src]

type Output = <F as Future>::Output

🔬 This is a nightly-only experimental API. (into_future)

The output that the future will produce on completion.

type Future = F

🔬 This is a nightly-only experimental API. (into_future)

Which kind of future are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<F, T, E> TryFuture for F where
    F: Future<Output = Result<T, E>> + ?Sized

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<Fut> TryFutureExt for Fut where
    Fut: TryFuture + ?Sized
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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