Interface ThreadChannel
- All Superinterfaces:
Channel
,Comparable<GuildChannel>
,Formattable
,GuildChannel
,GuildMessageChannel
,IMemberContainer
,IMentionable
,ISlowmodeChannel
,ISnowflake
,MessageChannel
These are also referred to as "posts" in the context of
Forum Channels
.
This includes all thread channel types, namely:
When a thread channel is archived
, no new members can be added.
You can use the manager
to unarchive
the thread.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The values permitted for the auto archive duration of aThreadChannel
. -
Field Summary
Fields inherited from interface net.dv8tion.jda.api.entities.channel.Channel
MAX_NAME_LENGTH
Fields inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
JUMP_URL
Fields inherited from interface net.dv8tion.jda.api.entities.channel.attribute.ISlowmodeChannel
MAX_SLOWMODE
-
Method Summary
Modifier and TypeMethodDescriptiondefault RestAction<Void>
addThreadMember
(Member member) Adds a member to this thread.default RestAction<Void>
addThreadMember
(User user) Adds a member to this thread.addThreadMemberById
(long id) Adds a member to this thread.default RestAction<Void>
Adds a member to this thread.default void
Theforum tags
applied to this thread.The inactivity timeout of this thread.Returns theChannelManager
for this GuildChannel.int
Gets the current number of members that have joined this thread.int
Gets the current number of messages present in this thread.default Member
getOwner()
Gets theMember
that created and owns this thread.default String
Gets theUser
of the owner of this thread as a String.long
Gets the ID of the owner of this thread as a long.default ThreadMember
Gets the owner of this thread as aThreadMember
.Gets theparent channel
of this thread.default GuildMessageChannelUnion
default ThreadMember
Gets the self member, as a member of this thread.default ThreadMember
getThreadMember
(Member member) Gets aThreadMember
of this thread by theirMember
.default ThreadMember
getThreadMember
(User user) Gets aThreadMember
of this thread by theirMember
.getThreadMemberById
(long id) Gets aThreadMember
of this thread by theirMember
.default ThreadMember
Gets aThreadMember
of this thread by theirMember
.Gets a List of all cachedmembers
of this thread.The last time the archive info of this thread was updated.The timestamp when this thread was created.int
The total number of messages sent in this thread, including all deleted messages.boolean
Whether this thread has been archived.boolean
Whether this thread is invitable.default boolean
isJoined()
Whether the currently logged in member has joined this thread.boolean
isLocked()
Whether this thread is locked or not.default boolean
isOwner()
Whether the current account is the owner of this thread.default boolean
isPinned()
Whether this thread is a pinned forum post.default boolean
isPublic()
Whether this thread is public or not.join()
Joins this thread, adding the current account to the member list of this thread.leave()
Leaves this thread, removing the current account from the member list of this thread.default RestAction<Void>
removeThreadMember
(Member member) Removes a member from this thread.default RestAction<Void>
removeThreadMember
(User user) Removes a member from this thread.removeThreadMemberById
(long id) Removes a member from this thread.default RestAction<Void>
Removes a member from this thread.Attempts to get theMessage
that this thread was started from.Attempts to get theMessage
that was posted when this thread was created.default CacheRestAction<ThreadMember>
retrieveThreadMember
(Member member) Load the thread-member for the specified user.default CacheRestAction<ThreadMember>
retrieveThreadMember
(User user) Load the thread-member for the specified user.retrieveThreadMemberById
(long id) Load the thread-member for the user with the specified id.default CacheRestAction<ThreadMember>
Load the thread-member for the user with the specified id.Retrieves theThreadMembers
of this thread.Methods inherited from interface net.dv8tion.jda.api.entities.channel.Channel
getAsMention, getFlags, getJDA, getName, getType
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildChannel
delete, getGuild, getJumpUrl, getPermissionContainer
Methods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel
canTalk, canTalk, clearReactionsById, clearReactionsById, clearReactionsById, clearReactionsById, deleteMessages, deleteMessagesByIds, removeReactionById, removeReactionById, sendStickers, sendStickers
Methods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.IMemberContainer
getMembers
Methods inherited from interface net.dv8tion.jda.api.entities.channel.attribute.ISlowmodeChannel
getSlowmode
Methods inherited from interface net.dv8tion.jda.api.entities.ISnowflake
getId, getIdLong
Methods inherited from interface net.dv8tion.jda.api.entities.channel.middleman.MessageChannel
addReactionById, addReactionById, deleteMessageById, deleteMessageById, editMessageAttachmentsById, editMessageAttachmentsById, editMessageAttachmentsById, editMessageAttachmentsById, editMessageById, editMessageById, editMessageById, editMessageById, editMessageComponentsById, editMessageComponentsById, editMessageComponentsById, editMessageComponentsById, editMessageEmbedsById, editMessageEmbedsById, editMessageEmbedsById, editMessageEmbedsById, editMessageFormatById, editMessageFormatById, endPollById, endPollById, getHistory, getHistoryAfter, getHistoryAfter, getHistoryAfter, getHistoryAround, getHistoryAround, getHistoryAround, getHistoryBefore, getHistoryBefore, getHistoryBefore, getHistoryFromBeginning, getIterableHistory, getLatestMessageId, getLatestMessageIdLong, pinMessageById, pinMessageById, purgeMessages, purgeMessages, purgeMessagesById, purgeMessagesById, purgeMessagesById, removeReactionById, removeReactionById, retrieveMessageById, retrieveMessageById, retrievePinnedMessages, retrievePollVotersById, retrievePollVotersById, retrieveReactionUsersById, retrieveReactionUsersById, sendFiles, sendFiles, sendMessage, sendMessage, sendMessageComponents, sendMessageComponents, sendMessageEmbeds, sendMessageEmbeds, sendMessageFormat, sendMessagePoll, sendTyping, unpinMessageById, unpinMessageById
-
Method Details
-
isPublic
default boolean isPublic()Whether this thread is public or not.Public threads can be read and joined by anyone with read access to its
parent channel
.- Returns:
- true if this thread is public, false otherwise.
-
getMessageCount
int getMessageCount()Gets the current number of messages present in this thread.
Threads started from seed messages in theparent channel
will not count that seed message.
This will be capped at 50 for threads created before July 1, 2022.- Returns:
- The number of messages sent in this thread
-
getTotalMessageCount
int getTotalMessageCount()The total number of messages sent in this thread, including all deleted messages.
This might be inaccurate for threads created before July 1, 2022.- Returns:
- The total number of messages ever sent in this thread
-
getMemberCount
int getMemberCount()Gets the current number of members that have joined this thread.
This is capped at 50, meaning any additional members will not affect this count.- Returns:
- The number of members that have joined this thread, capping at 50.
-
isJoined
default boolean isJoined()Whether the currently logged in member has joined this thread.- Returns:
- true if the self member has joined this thread, false otherwise.
-
isLocked
boolean isLocked()Whether this thread is locked or not.Locked threads cannot have new messages posted to them, or members join or leave them. Threads can only be locked and unlocked by moderators.
- Returns:
- true if this thread is locked, false otherwise.
- See Also:
-
isInvitable
boolean isInvitable()Whether this thread is invitable.
A thread that is invitable can have non-moderators invite other non-moderators to it. A thread that is not invitable can only have moderators invite others to it.This property is exclusive to private threads.
- Returns:
- true if this thread is invitable, false otherwise.
- Throws:
UnsupportedOperationException
- If this thread is not a private thread.- See Also:
-
isPinned
default boolean isPinned()Whether this thread is a pinned forum post.- Returns:
- True, if this is a pinned forum post.
-
getParentChannel
Gets theparent channel
of this thread.- Returns:
- The parent channel of this thread.
- See Also:
-
getParentMessageChannel
Gets theparent channel
of this thread, if it is aTextChannel
,NewsChannel
, orVoiceChannel
.
This is a convenience method that will perform the cast if possible, throwing otherwise.- Returns:
- The parent channel of this thread, as a
GuildMessageChannelUnion
. - Throws:
UnsupportedOperationException
- If the parent channel is not aGuildMessageChannel
.
-
getAppliedTags
Theforum tags
applied to this thread.
This will be an empty list if the thread was not created in aForumChannel
. -
retrieveParentMessage
Attempts to get theMessage
that this thread was started from.
The parent message was posted in theparent channel
and a thread was started on it.The
Message.getMember()
method will always return null for the resulting message. To retrieve the member you can usegetGuild().retrieveMember(message.getAuthor())
.The following
ErrorResponses
are possible:MISSING_ACCESS
The request was attempted after the account lost access to theGuild
typically due to being kicked or removed, or afterPermission.VIEW_CHANNEL
was revoked in theGuildMessageChannel
MISSING_PERMISSIONS
The request was attempted after the account lostPermission.MESSAGE_HISTORY
in theGuildMessageChannel
.UNKNOWN_MESSAGE
The message has already been deleted.UNKNOWN_CHANNEL
The request was attempted after the parent channel was deleted.
- Returns:
RestAction
- Type: Message
The Message that started this thread- Throws:
InsufficientPermissionException
- If this is aGuildMessageChannel
and the logged in account does not haveUnsupportedOperationException
- If the parent channel is not aGuildMessageChannel
.
-
retrieveStartMessage
Attempts to get theMessage
that was posted when this thread was created.
UnlikeretrieveParentMessage()
, the message was posted only inside the thread channel. This is common forForumChannel
posts.The
Message.getMember()
method will always return null for the resulting message. To retrieve the member you can usegetGuild().retrieveMember(message.getAuthor())
.This is equivalent to
channel.retrieveMessageById(channel.getId())
.The following
ErrorResponses
are possible:MISSING_ACCESS
The request was attempted after the account lost access to theGuild
typically due to being kicked or removed, or afterPermission.VIEW_CHANNEL
was revoked in theGuildMessageChannel
MISSING_PERMISSIONS
The request was attempted after the account lostPermission.MESSAGE_HISTORY
in theGuildMessageChannel
.UNKNOWN_MESSAGE
The message has already been deleted or there was no starting message.UNKNOWN_CHANNEL
The request was attempted after the parent channel was deleted.
- Returns:
RestAction
- Type: Message- Throws:
InsufficientPermissionException
- If this is aGuildMessageChannel
and the logged in account does not have
-
getSelfThreadMember
Gets the self member, as a member of this thread.If the current account is not a member of this thread, this will return null.
- Returns:
- The self member of this thread, null if the current account is not a member of this thread.
- See Also:
-
getThreadMembers
Gets a List of all cachedmembers
of this thread.The thread owner is not included in this list, unless the current account is the owner. Any updates to this cache are lost when JDA is shutdown, and this list is not sent to JDA on startup. For this reason,
retrieveThreadMembers()
should be used instead in most cases.The cache this method relies on is empty until JDA sees a member join via a
ThreadMemberJoinEvent
.
If the current account is a member of this ThreadChannel, this cache will contain the current account, even after a restart.
In order for this cache to be updated, the following requirements must be met:- the
GatewayIntent.GUILD_MEMBERS
intent must be enabled. - the bot must be able to join the thread (either via the
MANAGE_THREADS
permission, or a public thread) - the bot must have be online to receive the update
- Returns:
- List of all
members
of this thread. This list may be empty, but not null. - See Also:
- the
-
getThreadMember
Gets aThreadMember
of this thread by theirMember
.Note that this operation relies on the
ThreadMember cache
for this ThreadChannel. As the cache is likely to be unpopulated, this method is likely to return null.Use of
retrieveThreadMember(Member)
is preferred instead, once it is released.- Parameters:
member
- The member to get theThreadMember
for.- Returns:
- The
ThreadMember
of this thread for the given member. - Throws:
IllegalArgumentException
- If the given member is null.- See Also:
-
getThreadMember
Gets aThreadMember
of this thread by theirMember
.Note that this operation relies on the
ThreadMember cache
for this ThreadChannel. As the cache is likely to be unpopulated, this method is likely to return null.Use of
retrieveThreadMember(Member)
is preferred instead, once it is released.- Parameters:
user
- The user to get theThreadMember
for.- Returns:
- The
ThreadMember
of this thread for the given member. - Throws:
IllegalArgumentException
- If the given user is null.- See Also:
-
getThreadMemberById
Gets aThreadMember
of this thread by theirMember
.Note that this operation relies on the
ThreadMember cache
for this ThreadChannel. As the cache is likely to be unpopulated, this method is likely to return null.Use of
retrieveThreadMember(Member)
is preferred instead, once it is released.- Parameters:
id
- The ID of the member to get theThreadMember
for.- Returns:
- The
ThreadMember
of this thread for the given member. - Throws:
IllegalArgumentException
- If the given id is null or empty.- See Also:
-
getThreadMemberById
Gets aThreadMember
of this thread by theirMember
.Note that this operation relies on the
ThreadMember cache
for this ThreadChannel. As the cache is likely to be unpopulated, this method is likely to return null.Use of
retrieveThreadMember(Member)
is preferred instead, once it is released.- Parameters:
id
- The member to get theThreadMember
for.- Returns:
- The
ThreadMember
of this thread for the given member. - See Also:
-
retrieveThreadMember
@Nonnull @CheckReturnValue default CacheRestAction<ThreadMember> retrieveThreadMember(@Nonnull Member member) Load the thread-member for the specified user.
If the thread-member is already loaded it, will be retrieved fromgetThreadMemberById(long)
and immediately provided if the thread-member information is consistent. If the bot hasn't joined the thread,GatewayIntent.GUILD_MEMBERS
is required to keep the cache updated.- Parameters:
member
- The member to load the thread-member from- Returns:
CacheRestAction
- Type:ThreadMember
- Throws:
IllegalArgumentException
- If provided with null
-
retrieveThreadMember
@Nonnull @CheckReturnValue default CacheRestAction<ThreadMember> retrieveThreadMember(@Nonnull User user) Load the thread-member for the specified user.
If the thread-member is already loaded, it will be retrieved fromgetThreadMemberById(long)
and immediately provided if the thread-member information is consistent. If the bot hasn't joined the thread,GatewayIntent.GUILD_MEMBERS
is required to keep the cache updated.- Parameters:
user
- The user to load the thread-member from- Returns:
CacheRestAction
- Type:ThreadMember
- Throws:
IllegalArgumentException
- If provided with null
-
retrieveThreadMemberById
@Nonnull @CheckReturnValue default CacheRestAction<ThreadMember> retrieveThreadMemberById(@Nonnull String id) Load the thread-member for the user with the specified id.
If the thread-member is already loaded, it will be retrieved fromgetThreadMemberById(long)
and immediately provided if the thread-member information is consistent. If the bot hasn't joined the thread,GatewayIntent.GUILD_MEMBERS
is required to keep the cache updated.- Parameters:
id
- The user id to load the thread-member from- Returns:
CacheRestAction
- Type:ThreadMember
- Throws:
IllegalArgumentException
- If the provided id is empty or nullNumberFormatException
- If the provided id is not a snowflake
-
retrieveThreadMemberById
Load the thread-member for the user with the specified id.
If the thread-member is already loaded, it will be retrieved fromgetThreadMemberById(long)
and immediately provided if the thread-member information is consistent. If the bot hasn't joined the thread,GatewayIntent.GUILD_MEMBERS
is required to keep the cache updated.- Parameters:
id
- The user id to load the thread-member from- Returns:
CacheRestAction
- Type:ThreadMember
-
retrieveThreadMembers
Retrieves theThreadMembers
of this thread.This requires the
GatewayIntent.GUILD_MEMBERS
intent to be enabled in the Application Dashboard.- Returns:
ThreadMemberPaginationAction
-
isOwner
default boolean isOwner()Whether the current account is the owner of this thread.- Returns:
- true if the self account is the owner of this thread, false otherwise.
-
getOwnerIdLong
long getOwnerIdLong()Gets the ID of the owner of this thread as a long.- Returns:
- the ID of the member who created this thread as a long.
-
getOwnerId
Gets theUser
of the owner of this thread as a String.- Returns:
- The
User
of the member who created this thread as a String.
-
getOwner
Gets theMember
that created and owns this thread.
This will be null if the member is not cached, and so it is recommended toretrieve this member from the guild
usingthe owner'd ID
.- Returns:
- The
Member
of the member who created this thread. - See Also:
-
getOwnerThreadMember
Gets the owner of this thread as aThreadMember
.
This will be null if the member is not cached, and so it is recommended to retrieve the owner instead.This method relies on the
getThreadMembers()
cache, and so it is recommended toretrieve the ThreadMember
bytheir ID
instead.- Returns:
- The owner of this thread as a
ThreadMember
. - See Also:
-
isArchived
boolean isArchived()Whether this thread has been archived.This method will consider locked channels to also be archived.
Archived threads are not deleted threads, but are considered inactive. They are not shown to clients in the channels list, but can still be navigated to and read. ThreadChannels may be unarchived as long as there is space for a new active thread.
- Returns:
- true if this thread has been archived, false otherwise.
- See Also:
-
getTimeArchiveInfoLastModified
The last time the archive info of this thread was updated.This timestamp will be updated when any of the following happen:
- The channel is archived
- The channel is unarchived
- The AUTO_ARCHIVE_DURATION is changed.
- Returns:
- the time of the last archive info update.
- See Also:
-
getAutoArchiveDuration
The inactivity timeout of this thread.If a message is not sent within this amount of time, the thread will be automatically hidden.
A thread archived this way can be unarchived by any member.
- Returns:
- The inactivity timeframe until a thread is automatically hidden.
- See Also:
-
getTimeCreated
The timestamp when this thread was created.
This will only be valid for threads created after 2022-01-09. Otherwise, this will return the timestamp of creation based on thethread's id.
- Specified by:
getTimeCreated
in interfaceISnowflake
- Returns:
- The timestamp when this thread was created
- See Also:
-
join
Joins this thread, adding the current account to the member list of this thread.Note that joining threads is not a requirement of getting events about the thread.
This will have no effect if the current account is already a member of this thread.The following
ErrorResponses
are possible:MISSING_ACCESS
The request was attempted after the account lost access to theGuild
typically due to being kicked or removed, or after access was lost to this ThreadChannel (either by losing access to the parent of a public ThreadChannel, or losingMANAGE_THREADS
to a private channel).UNKNOWN_CHANNEL
The request was attempted after the channel was deleted.
- Returns:
RestAction
- Throws:
IllegalStateException
- If this thread is archived.
-
leave
Leaves this thread, removing the current account from the member list of this thread.
This will have no effect if the current account is not a member of this thread.The following
ErrorResponses
are possible:MISSING_ACCESS
The request was attempted after the account lost access to theGuild
typically due to being kicked or removed.UNKNOWN_CHANNEL
The request was attempted after the channel was deleted.
- Returns:
RestAction
- Throws:
IllegalStateException
- If this thread is archived.
-
addThreadMemberById
Adds a member to this thread.
This will have no effect if the member is already a member of this thread.The following
ErrorResponses
are possible:MISSING_ACCESS
This can be caused by any of the following:- The request was attempted after the account lost access to the
Guild
, typically due to being kicked or removed. - The user supplied is not a member of this ThreadChannel's
Guild
- The thread is not
invitable
, and the current account does not have theMANAGE_THREADS
permission.
- The request was attempted after the account lost access to the
UNKNOWN_CHANNEL
The request was attempted after the channel was deleted.UNKNOWN_USER
The provided User ID does not belong to a user.INVALID_FORM_BODY
The provided User ID is not a valid snowflake.
- Parameters:
id
- The id of the member to add.- Returns:
RestAction
- Throws:
InsufficientPermissionException
-- If this is a
private thread
or notisInvitable()
, and the bot does not haveMANAGE_THREADS
permission and is not thegetOwner()
. - If the bot does not have
MESSAGE_SEND_IN_THREADS
permission in the parent channel.
- If this is a
IllegalStateException
- If this thread is archived.
-
addThreadMemberById
Adds a member to this thread.
This will have no effect if the member is already a member of this thread.The following
ErrorResponses
are possible:MISSING_ACCESS
This can be caused by any of the following:- The request was attempted after the account lost access to the
Guild
, typically due to being kicked or removed. - The user supplied is not a member of this ThreadChannel's
Guild
- The thread is not
invitable
, and the current account does not have theMANAGE_THREADS
permission.
- The request was attempted after the account lost access to the
UNKNOWN_CHANNEL
The request was attempted after the channel was deleted.UNKNOWN_USER
The provided User ID does not belong to a user.INVALID_FORM_BODY
The provided User ID is not a valid snowflake.
- Parameters:
id
- The id of the member to add.- Returns:
RestAction
- Throws:
InsufficientPermissionException
-- If this is a
private thread
or notisInvitable()
, and the bot does not haveMANAGE_THREADS
permission and is not thegetOwner()
. - If the bot does not have
MESSAGE_SEND_IN_THREADS
permission in the parent channel.
- If this is a
IllegalStateException
- If this thread is locked or archivedIllegalArgumentException
- If the provided id is not a valid snowflake.
-
addThreadMember
Adds a member to this thread.
This will have no effect if the member is already a member of this thread.The following
ErrorResponses
are possible:MISSING_ACCESS
This can be caused by any of the following:- The request was attempted after the account lost access to the
Guild
, typically due to being kicked or removed. - The user supplied is not a member of this ThreadChannel's
Guild
- The thread is not
invitable
, and the current account does not have theMANAGE_THREADS
permission.
- The request was attempted after the account lost access to the
UNKNOWN_CHANNEL
The request was attempted after the channel was deleted.
- Parameters:
user
- TheUser
to add.- Returns:
RestAction
- Throws:
InsufficientPermissionException
-- If this is a
private thread
or notisInvitable()
, and the bot does not haveMANAGE_THREADS
permission and is not thegetOwner()
. - If the bot does not have
MESSAGE_SEND_IN_THREADS
permission in the parent channel.
- If this is a
IllegalStateException
- If this thread is locked or archived.IllegalArgumentException
- If the provided user is null.
-
addThreadMember
Adds a member to this thread.
This will have no effect if the member is already a member of this thread.The following
ErrorResponses
are possible:MISSING_ACCESS
This can be caused by any of the following:- The request was attempted after the account lost access to the
Guild
, typically due to being kicked or removed. - The user supplied is not a member of this ThreadChannel's
Guild
- The thread is not
invitable
, and the current account does not have theMANAGE_THREADS
permission.
- The request was attempted after the account lost access to the
UNKNOWN_CHANNEL
The request was attempted after the channel was deleted.
- Parameters:
member
- TheMember
to add.- Returns:
RestAction
- Throws:
InsufficientPermissionException
-- If this is a
private thread
or notisInvitable()
, and the bot does not haveMANAGE_THREADS
permission and is not thegetOwner()
. - If the bot does not have
MESSAGE_SEND_IN_THREADS
permission in the parent channel.
- If this is a
IllegalStateException
- If this thread is locked or archived.IllegalArgumentException
- If the provided member is null.
-
removeThreadMemberById
Removes a member from this thread.Removing members from threads requires the
Permission.MANAGE_THREADS
permission unless the thread is private and owned by the current account.The following
ErrorResponses
are possible:MISSING_ACCESS
The request was attempted after the account lost access to theGuild
typically due to being kicked or removed, or the bot losing permissions to perform this action.
This can also be caused if the user supplied is not a member of this ThreadChannel'sGuild
UNKNOWN_CHANNEL
The request was attempted after the channel was deleted.UNKNOWN_USER
The provided User ID does not belong to a user.INVALID_FORM_BODY
The provided User ID is not a valid snowflake.
- Parameters:
id
- The id of the member to remove from this thread.- Returns:
RestAction
- Throws:
InsufficientPermissionException
- If the account does not have thePermission.MANAGE_THREADS
permission, and this is not a private thread channel this account owns.
-
removeThreadMemberById
Removes a member from this thread.Removing members from threads requires the
Permission.MANAGE_THREADS
permission unless the thread is private and owned by the current account.The following
ErrorResponses
are possible:MISSING_ACCESS
The request was attempted after the account lost access to theGuild
typically due to being kicked or removed, or the bot losing permissions to perform this action.
This can also be caused if the user supplied is not a member of this ThreadChannel'sGuild
UNKNOWN_CHANNEL
The request was attempted after the channel was deleted.UNKNOWN_USER
The provided User ID does not belong to a user.INVALID_FORM_BODY
The provided User ID is not a valid snowflake.
- Parameters:
id
- The id of the member to remove from this thread.- Returns:
RestAction
- Throws:
InsufficientPermissionException
- If the account does not have thePermission.MANAGE_THREADS
permission, and this is not a private thread channel this account owns.IllegalArgumentException
- If the provided id is not a valid snowflake.
-
removeThreadMember
Removes a member from this thread.Removing members from threads requires the
Permission.MANAGE_THREADS
permission unless the thread is private and owned by the current account.The following
ErrorResponses
are possible:MISSING_ACCESS
The request was attempted after the account lost access to theGuild
typically due to being kicked or removed, or the bot losing permissions to perform this action.
This can also be caused if the user supplied is not a member of this ThreadChannel'sGuild
UNKNOWN_CHANNEL
The request was attempted after the channel was deleted.
- Parameters:
user
- The user to remove from this thread.- Returns:
RestAction
- Throws:
InsufficientPermissionException
- If the account does not have thePermission.MANAGE_THREADS
permission, and this is not a private thread channel this account owns.IllegalArgumentException
- If the provided user is null.
-
removeThreadMember
Removes a member from this thread.Removing members from threads requires the
Permission.MANAGE_THREADS
permission unless the thread is private and owned by the current account.The following
ErrorResponses
are possible:MISSING_ACCESS
The request was attempted after the account lost access to theGuild
typically due to being kicked or removed, or the bot losing permissions to perform this action.
This can also be caused if the member supplied is not a member of this ThreadChannel'sGuild
UNKNOWN_CHANNEL
The request was attempted after the channel was deleted.
Removing members from public threads or private threads this account does not own requires the
Permission.MANAGE_THREADS
permission.- Parameters:
member
- The member to remove from this thread.- Returns:
RestAction
- Throws:
InsufficientPermissionException
- If the account does not have thePermission.MANAGE_THREADS
permission, and this isn't a private thread channel this account owns.IllegalArgumentException
- If the provided member is null.
-
getManager
Description copied from interface:GuildChannel
Returns theChannelManager
for this GuildChannel.
In the ChannelManager, you can modify the name, topic and position of this GuildChannel. You modify multiple fields in one request by chaining setters before callingRestAction.queue()
.- Specified by:
getManager
in interfaceGuildChannel
- Specified by:
getManager
in interfaceISlowmodeChannel
- Returns:
- The ChannelManager of this GuildChannel
- See Also:
-
formatTo
- Specified by:
formatTo
in interfaceChannel
- Specified by:
formatTo
in interfaceFormattable
- Specified by:
formatTo
in interfaceIMentionable
-