Table of Contents

Method CreateChannelCategoryAsync

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

CreateChannelCategoryAsync(string, IEnumerable<DiscordOverwriteBuilder>?, int?, string?)

Creates a new channel category in this guild.

public Task<DiscordChannel> CreateChannelCategoryAsync(string name, IEnumerable<DiscordOverwriteBuilder>? overwrites = null, int? position = null, string? reason = null)

Parameters

name string

Name of the new category.

overwrites IEnumerable<DiscordOverwriteBuilder>

Permission overwrites for this category.

position int?

Sorting position of the channel.

reason string

Reason for audit logs.

Returns

Task<DiscordChannel>

The newly-created channel category.

Exceptions

UnauthorizedException

Thrown when the client does not have the ManageChannels permission.

NotFoundException

Thrown when the guild does not exist.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.