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 LegacyWebhookExecuteSpecaddEmbed(Consumer<? super LegacyEmbedCreateSpec> spec)LegacyWebhookExecuteSpecaddFile(String fileName, InputStream file)Adds a file as attachment to the createdMessage.LegacyWebhookExecuteSpecaddFileSpoiler(String fileName, InputStream file)Adds a spoiler file as attachment to the createdMessage.MultipartRequest<discord4j.discordjson.json.WebhookExecuteRequest>asRequest()LegacyWebhookExecuteSpecsetAllowedMentions(AllowedMentions allowedMentions)Adds an allowed mentions object to the webhook execute spec.LegacyWebhookExecuteSpecsetAvatarUrl(String avatarUrl)Sets an avatar that overrides the default avatar of theWebhook.LegacyWebhookExecuteSpecsetContent(String content)Sets the createdMessagecontents, up to 2000 characters.LegacyWebhookExecuteSpecsetTts(boolean tts)Sets whether the createdMessageis a TTS message.LegacyWebhookExecuteSpecsetUsername(String username)Sets a username that overrides the default username of theWebhook.
-
-
-
Method Detail
-
setContent
public LegacyWebhookExecuteSpec setContent(String content)
Sets the createdMessagecontents, 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 createdMessageis 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- AnLegacyEmbedCreateSpecconsumer 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:
asRequestin interfaceLegacySpec<MultipartRequest<discord4j.discordjson.json.WebhookExecuteRequest>>
-
-