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

#[non_exhaustive]
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>, }
Expand description

A category of GuildChannels.

Fields (Non-exhaustive)

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
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

Adds a permission overwrite to the category’s channels.

Note: Requires the Manage Channels permission.

Also requires the Manage Roles permission if not modifying the permissions for only the current user.

Errors

Returns Error::Http if the current user lacks permission, or if an invalid value was set.

Deletes all permission overrides in the category from the channels.

Note: Requires the Manage Roles permission.

Errors

Returns Error::Http if the current user lacks permission.

Deletes this category.

Note: Requires the Manage Channels permission.

Errors

Returns Error::Http if the current user lacks permission.

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

Refer to EditChannels documentation for a full list of methods.

Note: Requires the Manage Channels permission, also requires the Manage Roles permission if modifying permissions for the category.

Examples

Change a voice channels name and bitrate:

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

Errors

Returns Error::Http if an invalid value is set, or if the current user lacks the necessary permissions.

Returns the name of the category.

Trait Implementations

Look up a ChannelCategory by a string case-insensitively.

Lookup is done by the global cache, hence the cache feature needs to be enabled.

For more information, see the ArgumentConvert implementation for Channel

The associated error which can be returned from parsing.

Parses a string s as a command parameter of this type.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Creates a Mention that will be able to notify or create a link to the item. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.