Class ForumPostActionImpl
java.lang.Object
net.dv8tion.jda.internal.requests.RestActionImpl<ForumPost>
net.dv8tion.jda.internal.requests.restaction.ForumPostActionImpl
- All Implemented Interfaces:
FluentRestAction<ForumPost,
,ForumPostAction> RestAction<ForumPost>
,AbstractThreadCreateAction<ForumPost,
,ForumPostAction> ForumPostAction
,MessageCreateRequest<ForumPostAction>
,MessageData
,MessageRequest<ForumPostAction>
,AbstractMessageBuilderMixin<ForumPostAction,
,MessageCreateBuilder> MessageCreateBuilderMixin<ForumPostAction>
public class ForumPostActionImpl
extends RestActionImpl<ForumPost>
implements ForumPostAction, MessageCreateBuilderMixin<ForumPostAction>
-
Field Summary
Fields inherited from class net.dv8tion.jda.internal.requests.RestActionImpl
LOG
-
Constructor Summary
ConstructorsConstructorDescriptionForumPostActionImpl
(IPostContainer channel, String name, MessageCreateBuilder builder) -
Method Summary
Modifier and TypeMethodDescriptionaddCheck
(BooleanSupplier checks) Shortcut forsetCheck(() -> getCheck().getAsBoolean() && checks.getAsBoolean())
.deadline
(long timestamp) Similar toRestAction.timeout(long, TimeUnit)
but schedules a deadline at which the request has to be completed.TheIPostContainer
to create the post ingetGuild()
The guild to create thisGuildChannel
for.getType()
TheChannelType
for the resulting channel.setAutoArchiveDuration
(ThreadChannel.AutoArchiveDuration autoArchiveDuration) Sets theThreadChannel.AutoArchiveDuration
for the new thread.setCheck
(BooleanSupplier checks) Sets the last-second checks before finally executing the http request in the queue.Sets the name for the new GuildChannel.setSlowmode
(int slowmode) Sets the slowmode for the new thread.setTags
(Collection<? extends ForumTagSnowflake> tags) Configures that tags which should be applied to the new post.Methods inherited from class net.dv8tion.jda.internal.requests.RestActionImpl
complete, getCheck, getDefaultFailure, getDefaultSuccess, getDefaultTimeout, getJDA, handleResponse, isPassContext, priority, queue, setDefaultFailure, setDefaultSuccess, setDefaultTimeout, setErrorMapper, setPassContext, submit
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.dv8tion.jda.internal.utils.message.AbstractMessageBuilderMixin
getAllowedMentions, getComponents, getContent, getEmbeds, getMentionedRoles, getMentionedUsers, isMentionRepliedUser, isSuppressEmbeds, isUsingComponentsV2, mention, mentionRepliedUser, mentionRoles, mentionUsers, setAllowedMentions, setComponents, setContent, setEmbeds, setSuppressEmbeds, useComponentsV2
Methods inherited from interface net.dv8tion.jda.api.requests.FluentRestAction
timeout
Methods inherited from interface net.dv8tion.jda.api.requests.restaction.ForumPostAction
setTags
Methods inherited from interface net.dv8tion.jda.internal.utils.message.MessageCreateBuilderMixin
addComponents, addContent, addEmbeds, addFiles, getAttachments, getPoll, setFiles, setPoll, setSuppressedNotifications, setTTS, setVoiceMessage
Methods inherited from interface net.dv8tion.jda.api.utils.messages.MessageCreateRequest
addComponents, addComponents, addEmbeds, addFiles, applyData, applyEditData, applyMessage, getAttachments
Methods inherited from interface net.dv8tion.jda.api.utils.messages.MessageData
getComponentTree
Methods inherited from interface net.dv8tion.jda.api.utils.messages.MessageRequest
mention, mentionRoles, mentionRoles, mentionUsers, mentionUsers, setComponents, setComponents, setEmbeds, setFiles, useComponentsV2
Methods inherited from interface net.dv8tion.jda.api.requests.RestAction
and, and, complete, complete, completeAfter, delay, delay, delay, delay, flatMap, flatMap, getCheck, getJDA, map, mapToResult, onErrorFlatMap, onErrorFlatMap, onErrorMap, onErrorMap, onSuccess, queue, queue, queue, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, queueAfter, submit, submit, submitAfter, submitAfter, zip
-
Constructor Details
-
ForumPostActionImpl
-
-
Method Details
-
setCheck
Description copied from interface:RestAction
Sets the last-second checks before finally executing the http request in the queue.
If the provided supplier evaluates tofalse
or throws an exception this will not be finished. When an exception is thrown from the supplier it will be provided to the failure callback.- Specified by:
setCheck
in interfaceFluentRestAction<ForumPost,
ForumPostAction> - Specified by:
setCheck
in interfaceRestAction<ForumPost>
- Overrides:
setCheck
in classRestActionImpl<ForumPost>
- Parameters:
checks
- The checks to run before executing the request, ornull
to run no checks- Returns:
- The current RestAction for chaining convenience
- See Also:
-
addCheck
Description copied from interface:RestAction
Shortcut forsetCheck(() -> getCheck().getAsBoolean() && checks.getAsBoolean())
.- Specified by:
addCheck
in interfaceFluentRestAction<ForumPost,
ForumPostAction> - Specified by:
addCheck
in interfaceRestAction<ForumPost>
- Parameters:
checks
- Other checks to run- Returns:
- The current RestAction for chaining convenience
- See Also:
-
deadline
Description copied from interface:RestAction
Similar toRestAction.timeout(long, TimeUnit)
but schedules a deadline at which the request has to be completed.
If the deadline is reached, the request will fail with aTimeoutException
.This does not mean that the request will immediately timeout when the deadline is reached. JDA will check the deadline right before executing the request or within intervals in a worker thread. This only means the request will timeout if the deadline has passed.
Example
action.deadline(System.currentTimeMillis() + 10000) // 10 seconds from now .queueAfter(20, SECONDS); // request will not be executed within deadline and timeout immediately after 20 seconds
- Specified by:
deadline
in interfaceFluentRestAction<ForumPost,
ForumPostAction> - Specified by:
deadline
in interfaceRestAction<ForumPost>
- Overrides:
deadline
in classRestActionImpl<ForumPost>
- Parameters:
timestamp
- Millisecond timestamp at which the request will timeout- Returns:
- The same RestAction with the applied deadline
- See Also:
-
getGuild
Description copied from interface:AbstractThreadCreateAction
The guild to create thisGuildChannel
for.- Specified by:
getGuild
in interfaceAbstractThreadCreateAction<ForumPost,
ForumPostAction> - Returns:
- The guild
-
getChannel
Description copied from interface:ForumPostAction
TheIPostContainer
to create the post in- Specified by:
getChannel
in interfaceForumPostAction
- Returns:
- The
IPostContainer
-
setTags
Description copied from interface:ForumPostAction
Configures that tags which should be applied to the new post.
Some forums require setting at least one tag.- Specified by:
setTags
in interfaceForumPostAction
- Parameters:
tags
- Up to 5 tags to apply- Returns:
- The current ForumPostAction for chaining convenience
- See Also:
-
getType
Description copied from interface:AbstractThreadCreateAction
TheChannelType
for the resulting channel.- Specified by:
getType
in interfaceAbstractThreadCreateAction<ForumPost,
ForumPostAction> - Returns:
- The channel type
-
setName
Description copied from interface:AbstractThreadCreateAction
Sets the name for the new GuildChannel.- Specified by:
setName
in interfaceAbstractThreadCreateAction<ForumPost,
ForumPostAction> - Parameters:
name
- The not-null name for the new GuildChannel (up to 100 characters)- Returns:
- The current action, for chaining convenience
-
setAutoArchiveDuration
@Nonnull public ForumPostAction setAutoArchiveDuration(@Nonnull ThreadChannel.AutoArchiveDuration autoArchiveDuration) Description copied from interface:AbstractThreadCreateAction
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.- Specified by:
setAutoArchiveDuration
in interfaceAbstractThreadCreateAction<ForumPost,
ForumPostAction> - Parameters:
autoArchiveDuration
- The new archive inactivity duration (which hides the thread)- Returns:
- The current action, for chaining convenience
-
setSlowmode
Description copied from interface:AbstractThreadCreateAction
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_MANAGE
orMANAGE_CHANNEL
permission also grants immunity to slowmode.- Specified by:
setSlowmode
in interfaceAbstractThreadCreateAction<ForumPost,
ForumPostAction> - Parameters:
slowmode
- The new slowmode- Returns:
- The current action, for chaining convenience
- See Also:
-
getBuilder
- Specified by:
getBuilder
in interfaceAbstractMessageBuilderMixin<ForumPostAction,
MessageCreateBuilder>
-