Table of Contents

Method CreateChannelAsync

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

CreateChannelAsync(string, ChannelType, DiscordChannel?, Optional<string>, int?, int?, IEnumerable<DiscordOverwriteBuilder>?, bool?, Optional<int?>, VideoQualityMode?, ThreadAutoArchiveDuration?, Optional<ChannelFlags?>, string?)

Creates a new channel in this guild.

public Task<DiscordChannel> CreateChannelAsync(string name, ChannelType type, DiscordChannel? parent = null, Optional<string> topic = default, int? bitrate = null, int? userLimit = null, IEnumerable<DiscordOverwriteBuilder>? overwrites = null, bool? nsfw = null, Optional<int?> perUserRateLimit = default, VideoQualityMode? qualityMode = null, ThreadAutoArchiveDuration? defaultAutoArchiveDuration = null, Optional<ChannelFlags?> flags = default, string? reason = null)

Parameters

name string

Name of the new channel.

type ChannelType

Type of the new channel.

parent DiscordChannel

Category to put this channel in.

topic Optional<string>

Topic of the channel.

bitrate int?

Bitrate of the channel. Applies to voice only.

userLimit int?

Maximum number of users in the channel. Applies to voice only.

overwrites IEnumerable<DiscordOverwriteBuilder>

Permission overwrites for this channel.

nsfw bool?

Whether the channel is to be flagged as not safe for work. Applies to text only.

perUserRateLimit Optional<int?>

Slow mode timeout for users.

qualityMode VideoQualityMode?

Video quality mode of the channel. Applies to voice only.

defaultAutoArchiveDuration ThreadAutoArchiveDuration?

The default auto archive duration for new threads.

flags Optional<ChannelFlags?>

The flags of the new channel.

reason string

Reason for audit logs.

Returns

Task<DiscordChannel>

The newly-created channel.

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.