Struct serenity::model::channel::ChannelCategory [−][src]
pub struct ChannelCategory { pub id: ChannelId, pub category_id: Option<ChannelId>, pub position: i64, pub kind: ChannelType, pub name: String, pub nsfw: bool, pub permission_overwrites: Vec<PermissionOverwrite>, }
A category of GuildChannel
s.
Fields
id: ChannelId
Id of this category.
category_id: Option<ChannelId>
If this category belongs to another category.
position: i64
The position of this category.
kind: ChannelType
Indicator of the type of channel this is.
This should always be ChannelType::Category
.
name: String
The name of the category.
nsfw: bool
Whether this category is nsfw. (This'll be inherited by all channels in this category)
permission_overwrites: Vec<PermissionOverwrite>
Permission overwrites for the GuildChannel
s.
Methods
impl ChannelCategory
[src]
impl ChannelCategory
pub fn create_permission(&self, target: &PermissionOverwrite) -> Result<()>
[src]
pub fn create_permission(&self, target: &PermissionOverwrite) -> Result<()>
Adds a permission overwrite to the category's channels.
pub fn delete_permission(
&self,
permission_type: PermissionOverwriteType
) -> Result<()>
[src]
pub fn delete_permission(
&self,
permission_type: PermissionOverwriteType
) -> Result<()>
Deletes all permission overrides in the category from the channels.
Note: Requires the Manage Channel permission.
pub fn delete(&self) -> Result<()>
[src]
pub fn delete(&self) -> Result<()>
Deletes this category.
pub fn edit<F>(&mut self, f: F) -> Result<()> where
F: FnOnce(EditChannel) -> EditChannel,
[src]
pub fn edit<F>(&mut self, f: F) -> Result<()> where
F: FnOnce(EditChannel) -> EditChannel,
Modifies the category's settings, such as its position or name.
Refer to EditChannel
s documentation for a full list of methods.
Examples
Change a voice channels name and bitrate:
category.edit(|c| c.name("test").bitrate(86400));
pub fn is_nsfw(&self) -> bool
[src]
pub fn is_nsfw(&self) -> bool
pub fn name(&self) -> &str
[src]
pub fn name(&self) -> &str
Returns the name of the category.
Trait Implementations
impl Clone for ChannelCategory
[src]
impl Clone for ChannelCategory
fn clone(&self) -> ChannelCategory
[src]
fn clone(&self) -> ChannelCategory
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)
Performs copy-assignment from source
. Read more
impl Debug for ChannelCategory
[src]
impl Debug for ChannelCategory
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Mentionable for ChannelCategory
[src]
impl Mentionable for ChannelCategory
Auto Trait Implementations
impl Send for ChannelCategory
impl Send for ChannelCategory
impl Sync for ChannelCategory
impl Sync for ChannelCategory