Struct serenity::builder::CreateChannel [−][src]
Expand description
A builder for creating a new GuildChannel
in a Guild
.
Except Self::name
, all fields are optional.
Implementations
impl CreateChannel
[src]
impl CreateChannel
[src]pub fn name<D: ToString>(&mut self, name: D) -> &mut Self
[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]
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]
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]
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]
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]
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]
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]
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/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>,
[src]
pub fn permissions<I>(&mut self, perms: I) -> &mut Self where
I: IntoIterator<Item = PermissionOverwrite>,
[src]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 has already been bound. let permissions = vec![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]
impl Clone for CreateChannel
[src]fn clone(&self) -> CreateChannel
[src]
fn clone(&self) -> CreateChannel
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for CreateChannel
[src]
impl Debug for CreateChannel
[src]impl Default for CreateChannel
[src]
impl Default for CreateChannel
[src]fn default() -> Self
[src]
fn default() -> Self
[src]Creates a builder with default values, setting Self::kind
to ChannelType::Text
.
Examples
Create a default CreateChannel
builder:
use serenity::builder::CreateChannel; let channel_builder = CreateChannel::default();
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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,