Table of Contents

Method CreateThreadAsync

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

CreateThreadAsync(DiscordMessage, string, DiscordAutoArchiveDuration, string)

Creates a new thread within this channel from the given message.

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

Parameters

message DiscordMessage

Message to create the thread from.

name string

The name of the thread.

archiveAfter DiscordAutoArchiveDuration

The auto archive duration of the thread.

reason string

Reason for audit logs.

Returns

Task<DiscordThreadChannel>

The created thread.

Exceptions

NotFoundException

Thrown when the channel or message does not exist.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.

CreateThreadAsync(string, DiscordAutoArchiveDuration, DiscordChannelType, string)

Creates a new thread within this channel.

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

Parameters

name string

The name of the thread.

archiveAfter DiscordAutoArchiveDuration

The auto archive duration of the thread.

threadType DiscordChannelType

The type of thread to create, either a public, news or, private thread.

reason string

Reason for audit logs.

Returns

Task<DiscordThreadChannel>

The created thread.

Exceptions

NotFoundException

Thrown when the channel or message does not exist.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.