Method CreateTextChannelAsync
- Namespace
- Dis
Cat .EntitiesSharp
- Assembly
- DisCatSharp.dll
CreateTextChannelAsync(string, DiscordChannel?, Optional<string>, IEnumerable<DiscordOverwriteBuilder>?, bool?, Optional<int?>, ThreadAutoArchiveDuration, Optional<ChannelFlags?>, 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, ThreadAutoArchiveDuration defaultAutoArchiveDuration = ThreadAutoArchiveDuration.OneDay, Optional<ChannelFlags?> flags = default, string? reason = null)
Parameters
name
stringName of the new channel.
parent
DiscordChannel Category to put this channel in.
topic
Optional<string>Topic of the channel.
overwrites
IEnumerable<DiscordOverwrite >Builder Permission overwrites for this channel.
nsfw
bool?Whether the channel is to be flagged as not safe for work.
perUserRateLimit
Optional<int?>Slow mode timeout for users.
defaultAutoArchiveDuration
ThreadAuto Archive Duration The default auto archive duration for new threads.
flags
Optional<ChannelFlags ?>The flags of the new channel.
reason
stringReason for audit logs.
Returns
- Task<Discord
Channel > The newly-created channel.
Exceptions
- Unauthorized
Exception Thrown when the client does not have the Manage
Channels permission.- Not
Found Exception Thrown when the guild does not exist.
- Bad
Request Exception Thrown when an invalid parameter was provided.
- Server
Error Exception Thrown when Discord is unable to process the request.