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 thisGuildChannel
for.getType()
TheChannelType
for the resulting channel.setAutoArchiveDuration
(ThreadChannel.AutoArchiveDuration autoArchiveDuration) Sets theThreadChannel.AutoArchiveDuration
for the new thread.Sets the name for the new GuildChannel.Methods inherited from interface net.dv8tion.jda.api.requests.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
The guild to create thisGuildChannel
for.- Returns:
- The guild
-
getType
TheChannelType
for the resulting channel.- Returns:
- The channel type
-
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.AutoArchiveDuration
for 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
-