Struct serenity::builder::CreateChannel [−][src]
Expand description
A builder for creating a new GuildChannel
in a Guild
.
Except Self::name
, all fields are optional.
Tuple Fields
0: HashMap<&'static str, Value>
Implementations
Specify how to call this new channel.
Note: Must be between 2 and 100 characters long.
Specify what type the channel is, whether it’s a text, voice, category or news channel.
Specifiy the category, the “parent” of this channel.
Set an interesting topic.
Note: Must be between 0 and 1000 characters long.
Specify if this channel will be inappropriate to browse while at work.
[Voice-only] Specify the bitrate at which sound plays in the voice channel.
[Voice-only] Set how many users may occupy this voice channel.
👎 Deprecated: replaced by rate_limit_per_user
replaced by rate_limit_per_user
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).
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 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
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
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