[−][src]Struct serenity::builder::CreateChannel
A builder for creating a new GuildChannel
in a Guild
.
Except name
, all fields are optional.
Methods
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:
// Assuming a channel and a guild have already been bound. guild.create_channel(|c| c.name("my_new_cool_channel") .permissions(channel.permissions.clone()))
Trait Implementations
impl Clone for CreateChannel
[src]
fn clone(&self) -> CreateChannel
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for CreateChannel
[src]
fn default() -> Self
[src]
Creates a builder with default values, setting kind
to ChannelType::Text
.
Examples
Create a default CreateChannel
builder:
use serenity::builder::CreateChannel; let channel_builder = CreateChannel::default();
impl Debug for CreateChannel
[src]
Auto Trait Implementations
impl Sync for CreateChannel
impl Send for CreateChannel
impl Unpin for CreateChannel
impl RefUnwindSafe for CreateChannel
impl UnwindSafe for CreateChannel
Blanket Implementations
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T> DebugAny for T where
T: Any + Debug,
[src]
T: Any + Debug,
impl<T> CloneAny for T where
T: Clone + Any,
[src]
T: Clone + Any,
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
[src]
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
[src]
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
[src]
T: Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Send + Sync> where
T: Send + Sync,
[src]
T: Send + Sync,
impl<T> UnsafeAny for T where
T: Any,
T: Any,