Interface ThreadChannelManager
-
- All Superinterfaces:
AuditableRestAction<Void>,ChannelManager<ThreadChannel,ThreadChannelManager>,Manager<ThreadChannelManager>,RestAction<Void>
public interface ThreadChannelManager extends ChannelManager<ThreadChannel,ThreadChannelManager>
Manager providing functionality common for allThreadChannels.Example
manager.setSlowmode(10) .setArchived(false) .queue(); manager.reset(ChannelManager.SLOWMODE | ChannelManager.NAME) .setName("Java is to Javascript as car is to carpet") .setLocked(false) .setSlowmode(120) .queue();- See Also:
ThreadChannel.getManager(),ThreadChannel
-
-
Field Summary
-
Fields inherited from interface net.dv8tion.jda.api.managers.channel.ChannelManager
ARCHIVED, AUTO_ARCHIVE_DURATION, BITRATE, INVITEABLE, LOCKED, NAME, NSFW, PARENT, PERMISSION, POSITION, REGION, SLOWMODE, TOPIC, TYPE, USERLIMIT
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ThreadChannelManagersetArchived(boolean archived)Sets the archived state of this ThreadChannel.ThreadChannelManagersetAutoArchiveDuration(ThreadChannel.AutoArchiveDuration autoArchiveDuration)Sets the inactive time before autoarchiving of this ThreadChannel.ThreadChannelManagersetInvitable(boolean invitable)Sets the invitable state of this ThreadChannel.ThreadChannelManagersetLocked(boolean locked)Sets the locked state of this ThreadChannel.ThreadChannelManagersetSlowmode(int slowmode)Sets the slowmode of the selectedThreadChannel.-
Methods inherited from interface net.dv8tion.jda.api.requests.restaction.AuditableRestAction
reason
-
Methods inherited from interface net.dv8tion.jda.api.managers.channel.ChannelManager
getChannel, getGuild, reset, reset, setName
-
Methods inherited from interface net.dv8tion.jda.api.managers.Manager
deadline, reset, setCheck, timeout
-
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
addCheck, and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
-
-
-
Method Detail
-
setSlowmode
ThreadChannelManager setSlowmode(int slowmode)
Sets the slowmode of the selectedThreadChannel.
Provide0to reset the slowmode of theThreadChannel.A channel slowmode must not be negative nor greater than
TextChannel.MAX_SLOWMODE!Note: Bots are unaffected by this.
HavingMESSAGE_MANAGEorMANAGE_CHANNELpermission also grants immunity to slowmode.- Parameters:
slowmode- The new slowmode, in seconds, for the selectedThreadChannel- Returns:
- this ThreadChannelManager for chaining convenience
- Throws:
IllegalArgumentException- If the provided slowmode is negative or greater thanTextChannel.MAX_SLOWMODE- See Also:
ThreadChannel.getSlowmode()
-
setAutoArchiveDuration
ThreadChannelManager setAutoArchiveDuration(ThreadChannel.AutoArchiveDuration autoArchiveDuration)
Sets the inactive time before autoarchiving of this ThreadChannel. This is limited to the choices offered inThreadChannel.AutoArchiveDuration- Parameters:
autoArchiveDuration- The new duration before an inactive channel will be autoarchived.- Returns:
- this ThreadChannelManager for chaining convenience.
- Throws:
IllegalArgumentException- If the provided duration is not supported by this guild due to the guild boost requirements for higher durations.- See Also:
ThreadChannel.getAutoArchiveDuration()
-
setArchived
ThreadChannelManager setArchived(boolean archived)
Sets the archived state of this ThreadChannel.- Parameters:
archived- The new archived state for the selectedThreadChannel- Returns:
- this ThreadChannelManager for chaining convenience
- Throws:
InsufficientPermissionException- If the currently logged in account is not the thread owner or does not have theMANAGE_THREADSpermission.InsufficientPermissionException- If the thread is locked (archived by a moderator) and the current account does not have theMANAGE_THREADSpermission.- See Also:
ThreadChannel.isArchived()
-
setLocked
ThreadChannelManager setLocked(boolean locked)
Sets the locked state of this ThreadChannel. This is the equivalent of archiving as a moderator.- Parameters:
locked- The new locked state for the selectedThreadChannel- Returns:
- this ThreadChannelManager for chaining convenience.
- Throws:
InsufficientPermissionException- If the currently logged in account is not the thread owner or does not have theMANAGE_THREADSpermission.- See Also:
ThreadChannel.isLocked()
-
setInvitable
ThreadChannelManager setInvitable(boolean invitable)
Sets the invitable state of this ThreadChannel.
This property can only be set on private ThreadChannels.- Parameters:
invitable- The new invitable state for the selectedThreadChannel- Returns:
- this ThreadChannelManager for chaining convenience.
- Throws:
IllegalStateException- If the selectedThreadChannelis not a private ThreadChannelInsufficientPermissionException- If the currently logged in account is not the thread owner or does not have theMANAGE_THREADSpermission.- See Also:
ThreadChannel.isInvitable(),ThreadChannel.isPublic()
-
-