[][src]Struct serenity::model::channel::ChannelCategory

pub struct ChannelCategory {
    pub id: ChannelId,
    pub guild_id: GuildId,
    pub category_id: Option<ChannelId>,
    pub position: i64,
    pub kind: ChannelType,
    pub name: String,
    pub nsfw: bool,
    pub permission_overwrites: Vec<PermissionOverwrite>,
    // some fields omitted
}

A category of GuildChannels.

Fields

id: ChannelId

Id of this category.

guild_id: GuildId

Guild Id this category belongs to.

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 GuildChannels.

Implementations

impl ChannelCategory[src]

pub async fn create_permission<'_, '_>(
    &'_ self,
    http: impl AsRef<Http>,
    target: &'_ PermissionOverwrite
) -> Result<()>
[src]

Adds a permission overwrite to the category's channels.

pub async fn delete_permission<'_>(
    &'_ self,
    http: impl AsRef<Http>,
    permission_type: PermissionOverwriteType
) -> Result<()>
[src]

Deletes all permission overrides in the category from the channels.

Note: Requires the Manage Channel permission.

pub async fn delete<'_>(&'_ self, cache_http: impl CacheHttp) -> Result<()>[src]

Deletes this category if required permissions are met.

pub async fn edit<F, '_>(
    &'_ mut self,
    cache_http: impl CacheHttp,
    f: F
) -> Result<()> where
    F: FnOnce(&mut EditChannel) -> &mut EditChannel
[src]

Modifies the category's settings, such as its position or name.

Refer to EditChannels documentation for a full list of methods.

Examples

Change a voice channels name and bitrate:

category.edit(&http, |c| c.name("test").bitrate(86400)).await;

pub fn is_nsfw(&self) -> bool[src]

pub fn name(&self) -> &str[src]

Returns the name of the category.

Trait Implementations

impl Clone for ChannelCategory[src]

impl Debug for ChannelCategory[src]

impl<'de> Deserialize<'de> for ChannelCategory[src]

impl Mentionable for ChannelCategory[src]

impl Serialize for ChannelCategory[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]