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
messageDiscordMessageMessage to create the thread from.
namestringThe name of the thread.
archiveAfterDiscordAutoArchiveDurationThe auto archive duration of the thread.
reasonstringReason 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
namestringThe name of the thread.
archiveAfterDiscordAutoArchiveDurationThe auto archive duration of the thread.
threadTypeDiscordChannelTypeThe type of thread to create, either a public, news or, private thread.
reasonstringReason 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.