Package net.dv8tion.jda.api.entities
Interface IThreadContainer
- All Superinterfaces:
Channel
,Comparable<GuildChannel>
,Formattable
,GuildChannel
,IMentionable
,IPermissionContainer
,ISnowflake
- All Known Subinterfaces:
BaseGuildMessageChannel
,NewsChannel
,TextChannel
-
Method Summary
Modifier and TypeMethodDescriptiondefault ThreadChannelAction
createThreadChannel
(String name) Creates a new, publicThreadChannel
with the parent channel being thisIThreadContainer
.createThreadChannel
(String name, boolean isPrivate) Creates a newThreadChannel
with the parent channel being thisIThreadContainer
.createThreadChannel
(String name, long messageId) Creates a new, publicThreadChannel
with the parent channel being thisIThreadContainer
.default ThreadChannelAction
createThreadChannel
(String name, String messageId) Creates a new, publicThreadChannel
with the parent channel being thisIThreadContainer
.default List<ThreadChannel>
Finds allThreadChannels
whose parent is this channel.Methods inherited from interface net.dv8tion.jda.api.entities.Channel
formatTo, getAsMention, getJDA, getName, getType
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface net.dv8tion.jda.api.entities.GuildChannel
delete, getGuild, getPermissionContainer
Methods inherited from interface net.dv8tion.jda.api.entities.IPermissionContainer
createPermissionOverride, getManager, getMemberPermissionOverrides, getPermissionOverride, getPermissionOverrides, getRolePermissionOverrides, putPermissionOverride, upsertPermissionOverride
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong, getTimeCreated
-
Method Details
-
getThreadChannels
Finds allThreadChannels
whose parent is this channel.- Returns:
- a list of all ThreadChannel children.
-
createThreadChannel
Creates a new, publicThreadChannel
with the parent channel being thisIThreadContainer
. This requires the bot to have thePermission.VIEW_CHANNEL
andPermission.CREATE_PUBLIC_THREADS
permissions. The resultingThreadChannel
may be either one of:Possible
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMAX_CHANNELS
The maximum number of channels were exceededErrorResponse.MAX_ACTIVE_THREADS
The maximum number of active threads has been reached, and no more may be created.
- Parameters:
name
- The name of the new ThreadChannel- Returns:
- A specific
ThreadChannelAction
that may be used to configure the new ThreadChannel before its creation.
-
createThreadChannel
Creates a newThreadChannel
with the parent channel being thisIThreadContainer
. This requires the bot to have thePermission.VIEW_CHANNEL
andPermission.CREATE_PUBLIC_THREADS
permissions. The resultingThreadChannel
may be one of:Possible
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMAX_CHANNELS
The maximum number of channels were exceededErrorResponse.MAX_ACTIVE_THREADS
The maximum number of active threads has been reached, and no more may be created.ErrorResponse.MISSING_PERMISSIONS
Due to missing private thread permissions.
- Parameters:
name
- The name of the new ThreadChannelisPrivate
- The public/private status of the new ThreadChannel. If true, the new ThreadChannel will be private.- Returns:
- A specific
ThreadChannelAction
that may be used to configure the new ThreadChannel before its creation. - Throws:
InsufficientPermissionException
- if the ThreadChannel is set to private, and the logged in account does not havePermission.CREATE_PRIVATE_THREADS
.
-
createThreadChannel
Creates a new, publicThreadChannel
with the parent channel being thisIThreadContainer
. This ThreadChannel will be spawned from the given messageID, and will consequently share its ID with the message. This requires the bot to havePermission.VIEW_CHANNEL
andPermission.CREATE_PUBLIC_THREADS
permissions. The resultingThreadChannel
may be one of:Possible
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMAX_CHANNELS
The maximum number of channels were exceededErrorResponse.THREAD_WITH_THIS_MESSAGE_ALREADY_EXISTS
This message has already been used to create a threadErrorResponse.MAX_ACTIVE_THREADS
The maximum number of active threads has been reached, and no more may be created.
- Parameters:
name
- The name of the new ThreadChannelmessageId
- The ID of the message from which this ThreadChannel will be spawned.- Returns:
- A specific
ThreadChannelAction
that may be used to configure the new ThreadChannel before its creation.
-
createThreadChannel
@Nonnull @CheckReturnValue default ThreadChannelAction createThreadChannel(String name, String messageId) Creates a new, publicThreadChannel
with the parent channel being thisIThreadContainer
. This ThreadChannel will be spawned from the given messageID, and will consequently share its ID with the message. This requires the bot to havePermission.VIEW_CHANNEL
andPermission.CREATE_PUBLIC_THREADS
permissions. The resultingThreadChannel
may be one of:Possible
ErrorResponses
caused by the returnedRestAction
include the following:MISSING_PERMISSIONS
The channel could not be created due to a permission discrepancyMAX_CHANNELS
The maximum number of channels were exceededErrorResponse.THREAD_WITH_THIS_MESSAGE_ALREADY_EXISTS
This message has already been used to create a threadErrorResponse.MAX_ACTIVE_THREADS
The maximum number of active threads has been reached, and no more may be created.
- Parameters:
name
- The name of the new ThreadChannelmessageId
- The ID of the message from which this ThreadChannel will be spawned.- Returns:
- A specific
ThreadChannelAction
that may be used to configure the new ThreadChannel before its creation.
-
retrieveArchivedPublicThreadChannels
-
retrieveArchivedPrivateThreadChannels
-
retrieveArchivedPrivateJoinedThreadChannels
@Nonnull @CheckReturnValue ThreadChannelPaginationAction retrieveArchivedPrivateJoinedThreadChannels()
-