Package net.dv8tion.jda.api.entities
Interface IThreadContainer
-
- All Superinterfaces:
Channel,Comparable<GuildChannel>,Formattable,GuildChannel,IMentionable,IPermissionContainer,ISnowflake
- All Known Subinterfaces:
BaseGuildMessageChannel,NewsChannel,TextChannel
public interface IThreadContainer extends GuildChannel, IPermissionContainer
-
-
Method Summary
-
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 Detail
-
getThreadChannels
default List<ThreadChannel> getThreadChannels()
Finds allThreadChannelswhose parent is this channel.- Returns:
- a list of all ThreadChannel children.
-
createThreadChannel
@Nonnull @CheckReturnValue default ThreadChannelAction createThreadChannel(String name)
Creates a new, publicThreadChannelwith the parent channel being thisIThreadContainer. This requires the bot to have thePermission.VIEW_CHANNELandPermission.CREATE_PUBLIC_THREADSpermissions. The resultingThreadChannelmay be either one of:Possible
ErrorResponsescaused by the returnedRestActioninclude 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
ThreadChannelActionthat may be used to configure the new ThreadChannel before its creation.
-
createThreadChannel
@Nonnull @CheckReturnValue ThreadChannelAction createThreadChannel(String name, boolean isPrivate)
Creates a newThreadChannelwith the parent channel being thisIThreadContainer. This requires the bot to have thePermission.VIEW_CHANNELandPermission.CREATE_PUBLIC_THREADSpermissions. The resultingThreadChannelmay be one of:Possible
ErrorResponsescaused by the returnedRestActioninclude 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
ThreadChannelActionthat 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
@Nonnull @CheckReturnValue ThreadChannelAction createThreadChannel(String name, long messageId)
Creates a new, publicThreadChannelwith 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_CHANNELandPermission.CREATE_PUBLIC_THREADSpermissions. The resultingThreadChannelmay be one of:Possible
ErrorResponsescaused by the returnedRestActioninclude 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
ThreadChannelActionthat may be used to configure the new ThreadChannel before its creation.
-
createThreadChannel
@Nonnull @CheckReturnValue default ThreadChannelAction createThreadChannel(String name, String messageId)
Creates a new, publicThreadChannelwith 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_CHANNELandPermission.CREATE_PUBLIC_THREADSpermissions. The resultingThreadChannelmay be one of:Possible
ErrorResponsescaused by the returnedRestActioninclude 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
ThreadChannelActionthat may be used to configure the new ThreadChannel before its creation.
-
retrieveArchivedPublicThreadChannels
@Nonnull @CheckReturnValue ThreadChannelPaginationAction retrieveArchivedPublicThreadChannels()
-
retrieveArchivedPrivateThreadChannels
@Nonnull @CheckReturnValue ThreadChannelPaginationAction retrieveArchivedPrivateThreadChannels()
-
retrieveArchivedPrivateJoinedThreadChannels
@Nonnull @CheckReturnValue ThreadChannelPaginationAction retrieveArchivedPrivateJoinedThreadChannels()
-
-