Table of Contents

Method CreateThreadAsync

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

CreateThreadAsync(string, DiscordAutoArchiveDuration, string?)

Creates a new thread within this channel from this message.

public Task<DiscordThreadChannel> CreateThreadAsync(string name, DiscordAutoArchiveDuration archiveAfter, string? reason = null)

Parameters

name string

The name of the thread.

archiveAfter DiscordAutoArchiveDuration

The auto archive duration of the thread. Three and seven day archive options are locked behind level 2 and level 3 server boosts respectively.

reason string

Reason for audit logs.

Returns

Task<DiscordThreadChannel>

The created thread.

Exceptions

UnauthorizedException

Thrown when the client does not have the SendMessages permission.

NotFoundException

Thrown when the member does not exist.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.