Struct serenity::builder::EditChannel
source · [−]builder
only.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
sourceimpl EditChannel
impl EditChannel
sourcepub fn bitrate(&mut self, bitrate: u64) -> &mut Self
pub fn bitrate(&mut self, bitrate: u64) -> &mut Self
The bitrate of the channel in bits.
This is for voice channels only.
sourcepub fn video_quality_mode(&mut self, quality: VideoQualityMode) -> &mut Self
pub fn video_quality_mode(&mut self, quality: VideoQualityMode) -> &mut Self
The camera video quality mode of the channel.
This is for voice channels only.
sourcepub fn voice_region(&mut self, id: Option<String>) -> &mut Self
pub fn voice_region(&mut self, id: Option<String>) -> &mut Self
The voice region of the channel.
It is automatic when None
.
This is for voice channels only.
sourcepub fn name<S: ToString>(&mut self, name: S) -> &mut Self
pub fn name<S: ToString>(&mut self, name: S) -> &mut Self
The name of the channel.
Must be between 2 and 100 characters long.
sourcepub fn position(&mut self, position: u64) -> &mut Self
pub fn position(&mut self, position: u64) -> &mut Self
The position of the channel in the channel list.
sourcepub fn topic<S: ToString>(&mut self, topic: S) -> &mut Self
pub fn topic<S: ToString>(&mut self, topic: S) -> &mut Self
The topic of the channel. Can be empty.
Must be between 0 and 1024 characters long.
This is for text channels only.
sourcepub fn nsfw(&mut self, nsfw: bool) -> &mut Self
pub fn nsfw(&mut self, nsfw: bool) -> &mut Self
Is the channel inappropriate for work?
This is for text channels only.
sourcepub fn user_limit(&mut self, user_limit: u64) -> &mut Self
pub fn user_limit(&mut self, user_limit: u64) -> &mut Self
The number of users that may be in the channel simultaneously.
This is for voice channels only.
sourcepub fn rate_limit_per_user(&mut self, seconds: u64) -> &mut Self
pub fn rate_limit_per_user(&mut self, seconds: u64) -> &mut Self
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).
sourcepub 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 existing 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::VIEW_CHANNEL,
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
sourceimpl Clone for EditChannel
impl Clone for EditChannel
sourcefn clone(&self) -> EditChannel
fn clone(&self) -> EditChannel
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for EditChannel
impl Debug for EditChannel
sourceimpl Default for EditChannel
impl Default for EditChannel
sourcefn default() -> EditChannel
fn default() -> EditChannel
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
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