Method CreateThreadAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
CreateThreadAsync(string, ThreadAutoArchiveDuration, int?, string?)
Creates a thread. Depending on the ChannelType of the parent channel it's either a PublicThread or a NewsThread.
public Task<DiscordThreadChannel> CreateThreadAsync(string name, ThreadAutoArchiveDuration autoArchiveDuration = ThreadAutoArchiveDuration.OneHour, int? rateLimitPerUser = null, string? reason = null)
Parameters
name
stringThe name of the thread.
autoArchiveDuration
ThreadAutoArchiveDurationThreadAutoArchiveDuration till it gets archived. Defaults to OneHour
rateLimitPerUser
int?The per user ratelimit, aka slowdown.
reason
stringThe reason.
Returns
Exceptions
- UnauthorizedException
Thrown when the client does not have the CreatePrivateThreads or SendMessagesInThreads permission.
- NotFoundException
Thrown when the channel does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.