Class WebhookMessageCreateActionImpl<T>
java.lang.Object
net.dv8tion.jda.internal.requests.RestActionImpl<T>
net.dv8tion.jda.internal.requests.restaction.TriggerRestAction<T>
net.dv8tion.jda.internal.requests.restaction.AbstractWebhookMessageActionImpl<T,WebhookMessageCreateActionImpl<T>>
net.dv8tion.jda.internal.requests.restaction.WebhookMessageCreateActionImpl<T>
- All Implemented Interfaces:
FluentRestAction<T,
,WebhookMessageCreateAction<T>> RestAction<T>
,AbstractWebhookMessageAction<T,
,WebhookMessageCreateAction<T>> WebhookMessageCreateAction<T>
,MessageCreateRequest<WebhookMessageCreateAction<T>>
,MessageData
,MessageRequest<WebhookMessageCreateAction<T>>
,AbstractMessageBuilderMixin<WebhookMessageCreateAction<T>,
,MessageCreateBuilder> MessageCreateBuilderMixin<WebhookMessageCreateAction<T>>
public class WebhookMessageCreateActionImpl<T>
extends AbstractWebhookMessageActionImpl<T,WebhookMessageCreateActionImpl<T>>
implements WebhookMessageCreateAction<T>, MessageCreateBuilderMixin<WebhookMessageCreateAction<T>>
-
Field Summary
Fields inherited from class net.dv8tion.jda.internal.requests.RestActionImpl
LOG
-
Constructor Summary
ConstructorsConstructorDescriptionWebhookMessageCreateActionImpl
(JDA api, Route.CompiledRoute route, Function<DataObject, T> transformer) -
Method Summary
Modifier and TypeMethodDescriptioncreateThread
(ThreadCreateMetadata threadMetadata) Create a new thread channel for this webhook message.setAvatarUrl
(String iconUrl) Set the apparent avatar for the message author.setEphemeral
(boolean ephemeral) Set whether this message should be visible to other users.setInteraction
(boolean isInteraction) setUsername
(String name) Set the apparent username for the message author.Methods inherited from class net.dv8tion.jda.internal.requests.restaction.AbstractWebhookMessageActionImpl
deadline, setCheck, setThreadId
Methods inherited from class net.dv8tion.jda.internal.requests.restaction.TriggerRestAction
fail, onReady, queue, run, submit
Methods inherited from class net.dv8tion.jda.internal.requests.RestActionImpl
complete, getCheck, getDefaultFailure, getDefaultSuccess, getDefaultTimeout, getJDA, handleResponse, isPassContext, priority, setDefaultFailure, setDefaultSuccess, setDefaultTimeout, setErrorMapper, setPassContext
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.restaction.AbstractWebhookMessageAction
setThread, setThreadId, setThreadId
Methods inherited from interface net.dv8tion.jda.api.requests.FluentRestAction
addCheck, deadline, setCheck, timeout
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
Methods inherited from interface net.dv8tion.jda.api.requests.restaction.WebhookMessageCreateAction
createThread
-
Constructor Details
-
WebhookMessageCreateActionImpl
public WebhookMessageCreateActionImpl(JDA api, Route.CompiledRoute route, Function<DataObject, T> transformer)
-
-
Method Details
-
setInteraction
-
getBuilder
- Specified by:
getBuilder
in interfaceAbstractMessageBuilderMixin<WebhookMessageCreateAction<T>,
MessageCreateBuilder>
-
setEphemeral
Description copied from interface:WebhookMessageCreateAction
Set whether this message should be visible to other users.
When a message is ephemeral, it will only be visible to the user that used the interaction.Ephemeral messages have some limitations and will be removed once the user restarts their client.
Limitations:- Cannot be reacted to
- Can only be retrieved using the
InteractionHook
This only works on
InteractionHooks
! For adeferred reply
, this is not supported. When a reply is deferred, the very first message sent through theInteractionHook
, inherits the ephemeral state of the initial reply. To send an ephemeral deferred reply, you must usedeferReply(true)
instead. Note: Your message can appear ephemeral in several cases:- In guilds the bot is not a member of,
if the member is unable to
use external application
, this usually happens for user-installed commands - If the interaction user is unable to
send messages
- If the content contains elements the user does not have the permission to send (like files or embeds)
- If the content triggered AutoMod
- Specified by:
setEphemeral
in interfaceWebhookMessageCreateAction<T>
- Parameters:
ephemeral
- True, if this message should be invisible for other users- Returns:
- The same message action, for chaining convenience
-
setUsername
Description copied from interface:WebhookMessageCreateAction
Set the apparent username for the message author.
This changes the username that is shown for the message author.This cannot be used with
InteractionHooks
!- Specified by:
setUsername
in interfaceWebhookMessageCreateAction<T>
- Parameters:
name
- The username to use, or null to use the default- Returns:
- The same message action, for chaining convenience
-
setAvatarUrl
Description copied from interface:WebhookMessageCreateAction
Set the apparent avatar for the message author.
This changes the avatar that is shown for the message author.This cannot be used with
InteractionHooks
!- Specified by:
setAvatarUrl
in interfaceWebhookMessageCreateAction<T>
- Parameters:
iconUrl
- The URL to the avatar, or null to use default- Returns:
- The same message action, for chaining convenience
-
createThread
@Nonnull public WebhookMessageCreateAction<T> createThread(@Nonnull ThreadCreateMetadata threadMetadata) Description copied from interface:WebhookMessageCreateAction
Create a new thread channel for this webhook message.
This is currently limited to forum channels.
Does nothing if atarget thread
is already configured.This cannot be used with
InteractionHooks
!- Specified by:
createThread
in interfaceWebhookMessageCreateAction<T>
- Parameters:
threadMetadata
- The metadata for the thread- Returns:
- The same message action, for chaining convenience
- See Also:
-