Method CreateThreadAsync
- Namespace
- Dis
Cat .EntitiesSharp
- 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
ThreadAuto Archive Duration Thread
Auto till it gets archived. Defaults to OneArchive Duration Hour .type
ChannelType Can be either an Private
Thread , NewsThread or an PublicThread .rateLimitPerUser
int?The per user ratelimit, aka slowdown.
reason
stringAudit log reason.
Returns
- Task<Discord
Thread >Channel The created thread.
Exceptions
- Unauthorized
Exception Thrown when the client does not have the Create
Public or SendThreads Messages or if creating a private thread the CreateInThreads Private permission.Threads - Not
Found Exception Thrown when the guild hasn't enabled threads atm.
- Bad
Request Exception Thrown when an invalid parameter was provided.
- Server
Error Exception Thrown when Discord is unable to process the request.
- Not
Supported Exception Thrown when a wrong
type
was given.