Struct serenity::builder::EditChannel [−][src]
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.
👎 Deprecated: replaced by rate_limit_per_user
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).
pub fn permissions<I>(&mut self, perms: I) -> &mut Self where
I: IntoIterator<Item = PermissionOverwrite>,
pub fn permissions<I>(&mut self, perms: I) -> &mut Self where
I: IntoIterator<Item = PermissionOverwrite>,
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 the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for EditChannel
impl Send for EditChannel
impl Sync for EditChannel
impl Unpin for EditChannel
impl UnwindSafe for EditChannel
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
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