Method CreateThreadAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
CreateThreadAsync(string, ThreadAutoArchiveDuration, ChannelType, int?, string)
Creates a thread.
public Task<DiscordThreadChannel> CreateThreadAsync(string name, ThreadAutoArchiveDuration autoArchiveDuration = ThreadAutoArchiveDuration.OneHour, ChannelType type = ChannelType.PublicThread, int? rateLimitPerUser = null, string reason = null)
Parameters
name
stringThe name of the thread.
autoArchiveDuration
ThreadAutoArchiveDurationThreadAutoArchiveDuration till it gets archived. Defaults to OneHour.
type
ChannelTypeCan be either an PrivateThread, NewsThread or an PublicThread.
rateLimitPerUser
int?The per user ratelimit, aka slowdown.
reason
stringAudit log reason.
Returns
- Task<DiscordThreadChannel>
The created thread.
Exceptions
- UnauthorizedException
Thrown when the client does not have the CreatePublicThreads or SendMessagesInThreads or if creating a private thread the CreatePrivateThreads permission.
- NotFoundException
Thrown when the guild hasn't enabled threads atm.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.
- NotSupportedException
Thrown when a wrong
type
was given.