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>>
LegacySpec used to create Messages via a Webhook.
See Also:
  • Constructor Details

    • LegacyWebhookExecuteSpec

      public LegacyWebhookExecuteSpec()
  • Method Details

    • setContent

      public LegacyWebhookExecuteSpec setContent(String content)
      Sets the created Message 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 the Webhook.
      Parameters:
      username - The webhook username.
      Returns:
      This spec.
    • setAvatarUrl

      public LegacyWebhookExecuteSpec setAvatarUrl(String avatarUrl)
      Sets an avatar that overrides the default avatar of the Webhook.
      Parameters:
      avatarUrl - The url to the avatar.
      Returns:
      This spec.
    • setTts

      public LegacyWebhookExecuteSpec setTts(boolean tts)
      Sets whether the created Message 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 created Message.
      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 created Message.
      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)
      Adds rich content to the created Message in the form of an Embed object.
      Parameters:
      spec - An LegacyEmbedCreateSpec 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 interface LegacySpec<MultipartRequest<discord4j.discordjson.json.WebhookExecuteRequest>>