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
DiscordMessageMessage to create the thread from.
name
stringThe name of the thread.
archiveAfter
DiscordAutoArchiveDurationThe auto archive duration of the thread.
reason
stringReason 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
stringThe name of the thread.
archiveAfter
DiscordAutoArchiveDurationThe auto archive duration of the thread.
threadType
DiscordChannelTypeThe type of thread to create, either a public, news or, private thread.
reason
stringReason 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.