Interface AbstractThreadCreateAction<T, R extends AbstractThreadCreateAction<T,R>>
- Type Parameters:
T- The success type given to theRestAction.queue(Consumer, Consumer)success consumerR- The common return type of setters, allowing for fluid interface design
- All Superinterfaces:
RestAction<T>
- All Known Subinterfaces:
ForumPostAction, ThreadChannelAction
public interface AbstractThreadCreateAction<T, R extends AbstractThreadCreateAction<T,R>>
extends RestAction<T>
Common features of all
RestActions that create a new thread.-
Method Summary
Modifier and TypeMethodDescriptiongetGuild()The guild to create thisGuildChannelfor.getType()TheChannelTypefor the resulting channel.setAutoArchiveDuration(ThreadChannel.AutoArchiveDuration autoArchiveDuration) Sets theThreadChannel.AutoArchiveDurationfor the new thread.Sets the name for the new GuildChannel.setSlowmode(int slowmode) Sets the slowmode for the new thread.Methods inherited from interface RestAction
addCheck, and, and, complete, complete, completeAfter, deadline, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, onSuccess, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, setCheck, submit, submit, submitAfter, submitAfter, timeout, zip
-
Method Details
-
getGuild
-
getType
-
setName
Sets the name for the new GuildChannel.- Parameters:
name- The not-null name for the new GuildChannel (up to 100 characters)- Returns:
- The current action, for chaining convenience
- Throws:
IllegalArgumentException- If the provided name is null, empty, or longer than 100 characters
-
setAutoArchiveDuration
@Nonnull @CheckReturnValue R setAutoArchiveDuration(@Nonnull ThreadChannel.AutoArchiveDuration autoArchiveDuration) Sets theThreadChannel.AutoArchiveDurationfor the new thread.
This is primarily used to hide threads after the provided time of inactivity. Threads are automatically archived after 7 days of inactivity regardless.- Parameters:
autoArchiveDuration- The new archive inactivity duration (which hides the thread)- Returns:
- The current action, for chaining convenience
- Throws:
IllegalArgumentException- If the provided duration is null
-
setSlowmode
Sets the slowmode for the new thread.A channel slowmode must not be negative nor greater than
ISlowmodeChannel.MAX_SLOWMODE!Note: Bots are unaffected by this.
HavingMESSAGE_MANAGEorMANAGE_CHANNELpermission also grants immunity to slowmode.- Parameters:
slowmode- The new slowmode- Returns:
- The current action, for chaining convenience
- Throws:
InsufficientPermissionException- If the bot does not havePermission.MANAGE_THREADSin the parent channelIllegalArgumentException- If the provided slowmode is negative or greater than 21600- See Also:
-