Method CreateNewsChannelAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
CreateNewsChannelAsync(string, IEnumerable<DiscordOverwriteBuilder>, string, ThreadAutoArchiveDuration, Optional<ChannelFlags?>)
Creates a new news channel in this guild.
[RequiresFeature(Features.Community)]
public Task<DiscordChannel> CreateNewsChannelAsync(string name, IEnumerable<DiscordOverwriteBuilder> overwrites = null, string reason = null, ThreadAutoArchiveDuration defaultAutoArchiveDuration = ThreadAutoArchiveDuration.OneDay, Optional<ChannelFlags?> flags = default)
Parameters
name
stringName of the new news channel.
overwrites
IEnumerable<DiscordOverwriteBuilder>Permission overwrites for this news channel.
reason
stringReason for audit logs.
defaultAutoArchiveDuration
ThreadAutoArchiveDurationThe default auto archive duration for new threads.
flags
Optional<ChannelFlags?>The flags of the new channel.
Returns
- Task<DiscordChannel>
The newly-created news channel.
Exceptions
- UnauthorizedException
Thrown when the client does not have the ManageChannels.
- 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.
- NotSupportedException
Thrown when the guilds has not enabled community.