[−][src]Struct serenity::builder::CreateChannel
A builder for creating a new GuildChannel
in a Guild
.
Except name
, all fields are optional.
Implementations
impl CreateChannel
[src]
pub fn name<D: ToString>(&mut self, name: D) -> &mut Self
[src]
Specify how to call this new channel.
Note: Must be between 2 and 100 characters long.
pub fn kind(&mut self, kind: ChannelType) -> &mut Self
[src]
Specify what type the channel is, whether it's a text, voice, category or news channel.
pub fn category<I: Into<ChannelId>>(&mut self, id: I) -> &mut Self
[src]
Specifiy the category, the "parent" of this channel.
pub fn topic<D: ToString>(&mut self, topic: D) -> &mut Self
[src]
Set an interesting topic.
Note: Must be between 0 and 1000 characters long.
pub fn nsfw(&mut self, b: bool) -> &mut Self
[src]
Specify if this channel will be inappropriate to browse while at work.
pub fn bitrate(&mut self, rate: u32) -> &mut Self
[src]
[Voice-only] Specify the bitrate at which sound plays in the voice channel.
pub fn user_limit(&mut self, limit: u32) -> &mut Self
[src]
[Voice-only] Set how many users may occupy this voice channel.
pub fn rate_limit(&mut self, limit: u64) -> &mut Self
[src]
How many seconds must a user wait before sending another message.
Bots, or users with the MANAGE_MESSAGES
and/orMANAGE_CHANNEL
permissions are exempt
from this restriction.
Note: Must be between 0 and 21600 seconds (360 minutes or 6 hours).
pub fn position(&mut self, pos: u32) -> &mut Self
[src]
Specify where the channel should be located.
pub fn permissions<I>(&mut self, perms: I) -> &mut Self where
I: IntoIterator<Item = PermissionOverwrite>,
[src]
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 guild have already been bound. let permissions = Some(PermissionOverwrite { allow: Permissions::READ_MESSAGES, deny: Permissions::SEND_TTS_MESSAGES, kind: PermissionOverwriteType::Member(UserId(1234)), }); guild.create_channel(http, |c| { c.name("my_new_cool_channel") .permissions(permissions) }) .await?;
Trait Implementations
impl Clone for CreateChannel
[src]
fn clone(&self) -> CreateChannel
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for CreateChannel
[src]
impl Default for CreateChannel
[src]
Auto Trait Implementations
impl RefUnwindSafe for CreateChannel
impl Send for CreateChannel
impl Sync for CreateChannel
impl Unpin for CreateChannel
impl UnwindSafe for CreateChannel
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,