Class ThreadChannel
java.lang.Object
discord4j.core.object.entity.channel.ThreadChannel
- All Implemented Interfaces:
DiscordObject
,Channel
,GuildChannel
,GuildMessageChannel
,MessageChannel
,Entity
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Duration in minutes to automatically archive the thread after recent activity.static enum
Nested classes/interfaces inherited from interface discord4j.core.object.entity.channel.Channel
Channel.Flag
-
Constructor Summary
ConstructorsConstructorDescriptionThreadChannel
(GatewayDiscordClient gateway, discord4j.discordjson.json.ChannelData data) -
Method Summary
Modifier and TypeMethodDescriptionAdds a givenuser
to this thread.discord4j.core.spec.ThreadChannelEditMono
edit()
Requests to edit this thread channel.edit
(discord4j.core.spec.ThreadChannelEditSpec spec) Requests to edit this thread channel.final boolean
int
int
final GatewayDiscordClient
Returns theGatewayDiscordClient
that created this object.final discord4j.discordjson.json.ChannelData
getData()
Gets the raw data as represented by Discord.getEffectivePermissions
(Snowflake memberId) Gets the permissions for the given member, taking into account permission overwrites in this channel.getEffectivePermissions
(Member member) Gets the permissions for the given member, taking into account permission overwrites in this channel.Requests to retrieve the member of this thread.getMember
(Snowflake userId, EntityRetrievalStrategy retrievalStrategy) Requests to retrieve the member of this thread, using the given retrieval strategy.getParent
(EntityRetrievalStrategy retrievalStrategy) int
Gets the amount of seconds a user has to wait before sending another message (0-21600).final RestChannel
Return aRestChannel
handle to execute REST API operations on this entity.getStarter
(EntityRetrievalStrategy retrievalStrategy) Returns all members of this thread.getThreadMembers
(EntityRetrievalStrategy retrievalStrategy) Returns all members of this thread, using the given retrieval strategy.final int
hashCode()
boolean
boolean
isLocked()
boolean
join()
Adds the bot to this thread.leave()
Removes the bot from this thread.removeMember
(User user) Removes a givenuser
from this thread.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface discord4j.core.object.entity.channel.Channel
delete, delete, getData, getId, getMention, getRestChannel, getType
Methods inherited from interface discord4j.core.object.DiscordObject
getClient
Methods inherited from interface discord4j.core.object.entity.channel.GuildChannel
getGuild, getGuild, getGuildId, getName
Methods inherited from interface discord4j.core.object.entity.channel.GuildMessageChannel
bulkDelete, bulkDeleteMessages, getMembers
Methods inherited from interface discord4j.core.object.entity.channel.MessageChannel
createEmbed, createEmbed, createMessage, createMessage, createMessage, createMessage, getLastMessage, getLastMessage, getLastMessageId, getLastPinTimestamp, getMessageById, getMessageById, getMessagesAfter, getMessagesBefore, getPinnedMessages, type, typeUntil
-
Constructor Details
-
ThreadChannel
-
-
Method Details
-
getStarterId
-
getRateLimitPerUser
public int getRateLimitPerUser()Gets the amount of seconds a user has to wait before sending another message (0-21600).Bots, as well as users with the permission
manage_messages
ormanage_channel
, are unaffected.- Returns:
- The amount of seconds a user has to wait before sending another message (0-21600).
-
getStarter
-
getStarter
-
getParentId
-
getParent
-
getParent
-
getMember
Requests to retrieve the member of this thread. -
getMember
Requests to retrieve the member of this thread, using the given retrieval strategy. -
getThreadMembers
Returns all members of this thread. -
getThreadMembers
Returns all members of this thread, using the given retrieval strategy. -
getApproximateMessageCount
public int getApproximateMessageCount() -
getApproximateMemberCount
public int getApproximateMemberCount() -
isArchived
public boolean isArchived() -
getArchiveTimestamp
-
getAutoArchiveDuration
-
isLocked
public boolean isLocked() -
isPrivate
public boolean isPrivate() -
getEffectivePermissions
Description copied from interface:GuildChannel
Gets the permissions for the given member, taking into account permission overwrites in this channel.- Specified by:
getEffectivePermissions
in interfaceGuildChannel
- Parameters:
memberId
- The ID of the member to get permissions for.- Returns:
- The permissions for the given member.
-
getEffectivePermissions
Description copied from interface:GuildChannel
Gets the permissions for the given member, taking into account permission overwrites in this channel.- Specified by:
getEffectivePermissions
in interfaceGuildChannel
- Parameters:
member
- The member to get permissions for.- Returns:
- The permissions for the given member.
-
join
Adds the bot to this thread. Requires that the thread is not archived.- Returns:
- A
Mono
where, upon successful completion, emits an emptyMono
. If an error is received, it is emitted through theMono
.
-
leave
Removes the bot from this thread. Requires that the thread is not archived.- Returns:
- A
Mono
where, upon successful completion, emits an emptyMono
. If an error is received, it is emitted through theMono
.
-
addMember
Adds a givenuser
to this thread. Requires the ability to send messages in the thread. Also requires the thread is not archived. Returns successfully if the user is already a member of this thread.- Parameters:
user
- the member to add- Returns:
- A
Mono
where, upon successful completion, emits an emptyMono
. If an error is received, it is emitted through theMono
.
-
removeMember
Removes a givenuser
from this thread. Requires permission to manage threads, or the creator of the thread if it is a guild private thread. Also requires the thread is not archived.- Parameters:
user
- the member to remove- Returns:
- A
Mono
where, upon successful completion, emits an emptyMono
. If an error is received, it is emitted through theMono
.
-
edit
public discord4j.core.spec.ThreadChannelEditMono edit()Requests to edit this thread channel. Properties specifying how to edit this thread channel can be set via thewithXxx
methods of the returnedThreadChannelEditMono
.- Returns:
- A
ThreadChannelEditMono
where, upon successful completion, emits the editedThreadChannel
. If an error is received, it is emitted through theThreadChannelEditMono
.
-
edit
Requests to edit this thread channel.- Parameters:
spec
- an immutable object that specifies how to edit this thread channel- Returns:
- A
Mono
where, upon successful completion, emits the editedThreadChannel
. If an error is received, it is emitted through theMono
.
-
toString
-
getClient
Description copied from interface:DiscordObject
Returns theGatewayDiscordClient
that created this object. Methods in it are exclusively based on the entity cache orStore
in use. Refer to callinggetClient().rest()
to access aDiscordClient
that is capable of requesting entities directly from the REST API.- Specified by:
getClient
in interfaceDiscordObject
- Returns:
- The
GatewayDiscordClient
associated to this object.
-
getRestChannel
Description copied from interface:Channel
Return aRestChannel
handle to execute REST API operations on this entity.- Specified by:
getRestChannel
in interfaceChannel
-
getData
public final discord4j.discordjson.json.ChannelData getData()Description copied from interface:Channel
Gets the raw data as represented by Discord. -
equals
-
hashCode
public final int hashCode()
-