Method CreateTextChannelAsync
- Namespace
- DSharpPlus.Entities
- Assembly
- DSharpPlus.dll
CreateTextChannelAsync(string, DiscordChannel?, Optional<string>, IEnumerable<DiscordOverwriteBuilder>?, bool?, Optional<int?>, int?, string?)
Creates a new text channel in this guild.
public Task<DiscordChannel> CreateTextChannelAsync(string name, DiscordChannel? parent = null, Optional<string> topic = default, IEnumerable<DiscordOverwriteBuilder>? overwrites = null, bool? nsfw = null, Optional<int?> perUserRateLimit = default, int? position = null, string? reason = null)
Parameters
namestringName of the new channel.
parentDiscordChannelCategory to put this channel in.
topicOptional<string>Topic of the channel.
overwritesIEnumerable<DiscordOverwriteBuilder>Permission overwrites for this channel.
nsfwbool?Whether the channel is to be flagged as not safe for work.
perUserRateLimitOptional<int?>Slow mode timeout for users.
positionint?Sorting position of the channel.
reasonstringReason 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.