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:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddEmbed
(Consumer<? super LegacyEmbedCreateSpec> spec) addFile
(String fileName, InputStream file) Adds a file as attachment to the createdMessage
.addFileSpoiler
(String fileName, InputStream file) Adds a spoiler file as attachment to the createdMessage
.MultipartRequest<discord4j.discordjson.json.WebhookExecuteRequest>
setAllowedMentions
(AllowedMentions allowedMentions) Adds an allowed mentions object to the webhook execute spec.setAvatarUrl
(String avatarUrl) Sets an avatar that overrides the default avatar of theWebhook
.setContent
(String content) Sets the createdMessage
contents, up to 2000 characters.setTts
(boolean tts) Sets whether the createdMessage
is a TTS message.setUsername
(String username) Sets a username that overrides the default username of theWebhook
.
-
Constructor Details
-
LegacyWebhookExecuteSpec
public LegacyWebhookExecuteSpec()
-
-
Method Details
-
setContent
Sets the createdMessage
contents, up to 2000 characters.- Parameters:
content
- The message contents.- Returns:
- This spec.
-
setUsername
Sets a username that overrides the default username of theWebhook
.- Parameters:
username
- The webhook username.- Returns:
- This spec.
-
setAvatarUrl
Sets an avatar that overrides the default avatar of theWebhook
.- Parameters:
avatarUrl
- The url to the avatar.- Returns:
- This spec.
-
setTts
Sets whether the createdMessage
is a TTS message.- Parameters:
tts
- If created message is a TTS message.- Returns:
- This spec.
-
addFile
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
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
- Parameters:
spec
- AnLegacyEmbedCreateSpec
consumer used to attach rich content when creating a message.- Returns:
- This spec.
-
setAllowedMentions
Adds an allowed mentions object to the webhook execute spec.- Parameters:
allowedMentions
- The allowed mentions to add.- Returns:
- Tis spec.
-
asRequest
- Specified by:
asRequest
in interfaceLegacySpec<MultipartRequest<discord4j.discordjson.json.WebhookExecuteRequest>>
-