Table of Contents

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 string

The name of the thread.

autoArchiveDuration ThreadAutoArchiveDuration

ThreadAutoArchiveDuration till it gets archived. Defaults to OneHour.

type ChannelType

Can be either an PrivateThread, NewsThread or an PublicThread.

rateLimitPerUser int?

The per user ratelimit, aka slowdown.

reason string

Audit 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.