Table of Contents

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 string

The name of the thread.

autoArchiveDuration ThreadAutoArchiveDuration

ThreadAutoArchiveDuration till it gets archived. Defaults to OneHour

rateLimitPerUser int?

The per user ratelimit, aka slowdown.

reason string

The reason.

Returns

Task<DiscordThreadChannel>

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.