Struct serenity::builder::EditChannel[][src]

pub struct EditChannel(pub HashMap<&'static str, Value>);
Expand description

A builder to edit a GuildChannel for use via GuildChannel::edit

Defaults are not directly provided by the builder itself.

Examples

Edit a channel, providing a new name and topic:

// assuming a channel has already been bound
if let Err(why) = channel.edit(&http, |c| c.name("new name").topic("a test topic")).await {
    // properly handle the error
}

Tuple Fields

0: HashMap<&'static str, Value>

Implementations

The bitrate of the channel in bits.

This is for voice channels only.

The camera video quality mode of the channel.

This is for voice channels only.

The voice region of the channel. It is automatic when None.

This is for voice channels only.

The name of the channel.

Must be between 2 and 100 characters long.

The position of the channel in the channel list.

The topic of the channel. Can be empty.

Must be between 0 and 1024 characters long.

This is for text channels only.

Is the channel inappropriate for work?

This is for text channels only.

The number of users that may be in the channel simultaneously.

This is for voice channels only.

The parent category of the channel.

This is for text and voice channels only.

👎 Deprecated:

replaced by rate_limit_per_user

The seconds a user has to wait before sending another message.

Note: Must be between 0 and 21600 seconds (360 minutes or 6 hours).

How many seconds must a user wait before sending another message.

Bots, or users with the MANAGE_MESSAGES and/or MANAGE_CHANNELS permissions are exempt from this restriction.

Note: Must be between 0 and 21600 seconds (360 minutes or 6 hours).

A set of overwrites defining what a user or a user carrying a certain role can and cannot do.

Example

Inheriting permissions from an exisiting channel:

use serenity::model::channel::{PermissionOverwrite, PermissionOverwriteType};
use serenity::model::id::UserId;
use serenity::model::permissions::Permissions;

// Assuming a channel has already been bound.
let permissions = vec![PermissionOverwrite {
    allow: Permissions::READ_MESSAGES,
    deny: Permissions::SEND_TTS_MESSAGES,
    kind: PermissionOverwriteType::Member(UserId(1234)),
}];

channel.edit(http, |c| c.name("my_edited_cool_channel").permissions(permissions)).await?;

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

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

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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