Method CreateForumChannelAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
CreateForumChannelAsync(string, DiscordChannel?, Optional<string>, IEnumerable<DiscordOverwriteBuilder>?, bool?, Optional<ForumReactionEmoji>, Optional<int?>, Optional<int?>, ThreadAutoArchiveDuration, Optional<ForumPostSortOrder>, Optional<ForumLayout?>, Optional<ChannelFlags?>, string?)
Creates a new forum channel in this guild.
note
The field template is not yet released, so it won't applied.
public Task<DiscordChannel> CreateForumChannelAsync(string name, DiscordChannel? parent = null, Optional<string> topic = default, IEnumerable<DiscordOverwriteBuilder>? overwrites = null, bool? nsfw = null, Optional<ForumReactionEmoji> defaultReactionEmoji = default, Optional<int?> perUserRateLimit = default, Optional<int?> postCreateUserRateLimit = default, ThreadAutoArchiveDuration defaultAutoArchiveDuration = ThreadAutoArchiveDuration.OneDay, Optional<ForumPostSortOrder> defaultSortOrder = default, Optional<ForumLayout?> defaultLayout = default, Optional<ChannelFlags?> flags = default, string? reason = null)
Parameters
name
stringName of the new channel.
parent
DiscordChannelCategory to put this channel in.
topic
Optional<string>Topic of the channel.
overwrites
IEnumerable<DiscordOverwriteBuilder>Permission overwrites for this channel.
nsfw
bool?Whether the channel is to be flagged as not safe for work.
defaultReactionEmoji
Optional<ForumReactionEmoji>The default reaction emoji for posts.
perUserRateLimit
Optional<int?>Slow mode timeout for users.
postCreateUserRateLimit
Optional<int?>Slow mode timeout for user post creations.
defaultAutoArchiveDuration
ThreadAutoArchiveDurationThe default auto archive duration for new threads.
defaultSortOrder
Optional<ForumPostSortOrder>The default sort order for posts in the new channel.
defaultLayout
Optional<ForumLayout?>The default forum layout for this channel
flags
Optional<ChannelFlags?>The flags of the new channel.
reason
stringReason for audit logs.
Returns
- Task<DiscordChannel>
The newly-created channel.
Exceptions
- UnauthorizedException
Thrown when the client does not have the ManageChannels permission or the guild does not have the forum channel feature.
- 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.