Package discord4j.core.spec.legacy
Class LegacyWebhookExecuteSpec
- java.lang.Object
-
- discord4j.core.spec.legacy.LegacyWebhookExecuteSpec
-
- All Implemented Interfaces:
LegacySpec<MultipartRequest<discord4j.discordjson.json.WebhookExecuteRequest>>
public class LegacyWebhookExecuteSpec extends Object implements LegacySpec<MultipartRequest<discord4j.discordjson.json.WebhookExecuteRequest>>
- See Also:
- Execute webhook
-
-
Constructor Summary
Constructors Constructor Description LegacyWebhookExecuteSpec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LegacyWebhookExecuteSpec
addEmbed(Consumer<? super LegacyEmbedCreateSpec> spec)
LegacyWebhookExecuteSpec
addFile(String fileName, InputStream file)
Adds a file as attachment to the createdMessage
.LegacyWebhookExecuteSpec
addFileSpoiler(String fileName, InputStream file)
Adds a spoiler file as attachment to the createdMessage
.MultipartRequest<discord4j.discordjson.json.WebhookExecuteRequest>
asRequest()
LegacyWebhookExecuteSpec
setAllowedMentions(AllowedMentions allowedMentions)
Adds an allowed mentions object to the webhook execute spec.LegacyWebhookExecuteSpec
setAvatarUrl(String avatarUrl)
Sets an avatar that overrides the default avatar of theWebhook
.LegacyWebhookExecuteSpec
setContent(String content)
Sets the createdMessage
contents, up to 2000 characters.LegacyWebhookExecuteSpec
setTts(boolean tts)
Sets whether the createdMessage
is a TTS message.LegacyWebhookExecuteSpec
setUsername(String username)
Sets a username that overrides the default username of theWebhook
.
-
-
-
Method Detail
-
setContent
public LegacyWebhookExecuteSpec setContent(String content)
Sets the createdMessage
contents, up to 2000 characters.- Parameters:
content
- The message contents.- Returns:
- This spec.
-
setUsername
public LegacyWebhookExecuteSpec setUsername(String username)
Sets a username that overrides the default username of theWebhook
.- Parameters:
username
- The webhook username.- Returns:
- This spec.
-
setAvatarUrl
public LegacyWebhookExecuteSpec setAvatarUrl(String avatarUrl)
Sets an avatar that overrides the default avatar of theWebhook
.- Parameters:
avatarUrl
- The url to the avatar.- Returns:
- This spec.
-
setTts
public LegacyWebhookExecuteSpec setTts(boolean tts)
Sets whether the createdMessage
is a TTS message.- Parameters:
tts
- If created message is a TTS message.- Returns:
- This spec.
-
addFile
public LegacyWebhookExecuteSpec addFile(String fileName, InputStream file)
Adds a file as attachment to the createdMessage
.- Parameters:
fileName
- The filename used in the file being sent.file
- The file contents.- Returns:
- This spec.
-
addFileSpoiler
public LegacyWebhookExecuteSpec addFileSpoiler(String fileName, InputStream file)
Adds a spoiler file as attachment to the createdMessage
.- Parameters:
fileName
- The filename used in the file being sent.file
- The file contents.- Returns:
- This spec.
-
addEmbed
public LegacyWebhookExecuteSpec addEmbed(Consumer<? super LegacyEmbedCreateSpec> spec)
- Parameters:
spec
- AnLegacyEmbedCreateSpec
consumer used to attach rich content when creating a message.- Returns:
- This spec.
-
setAllowedMentions
public LegacyWebhookExecuteSpec setAllowedMentions(AllowedMentions allowedMentions)
Adds an allowed mentions object to the webhook execute spec.- Parameters:
allowedMentions
- The allowed mentions to add.- Returns:
- Tis spec.
-
asRequest
public MultipartRequest<discord4j.discordjson.json.WebhookExecuteRequest> asRequest()
- Specified by:
asRequest
in interfaceLegacySpec<MultipartRequest<discord4j.discordjson.json.WebhookExecuteRequest>>
-
-