Class CommandReplySpec

java.lang.Object
dev.sympho.modular_commands.api.command.reply.CommandReplySpec

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class CommandReplySpec extends Object
Specification for creating a new command reply.
Since:
1.0
Version:
1.0
  • Method Details

    • privately

      public discord4j.discordjson.possible.Possible<Boolean> privately()
      Whether to send the reply privately. If absent, the default for the command should be used.
      Returns:
      The value.
    • content

      public discord4j.discordjson.possible.Possible<String> content()
      The reply message content.
      Returns:
      The value.
    • tts

      public discord4j.discordjson.possible.Possible<Boolean> tts()
      Whether the reply should use TTS.
      Returns:
      The value.
    • embeds

      public discord4j.discordjson.possible.Possible<List<EmbedCreateSpec>> embeds()
      The reply embeds.
      Returns:
      The value.
    • files

      public List<MessageCreateFields.File> files()
      The attached files.
      Returns:
      The value.
    • fileSpoilers

      public List<MessageCreateFields.FileSpoiler> fileSpoilers()
      The spoiler-tagged attached files.
      Returns:
      The value.
    • allowedMentions

      public discord4j.discordjson.possible.Possible<discord4j.rest.util.AllowedMentions> allowedMentions()
      The allowed mentions.
      Returns:
      The value.
    • components

      public discord4j.discordjson.possible.Possible<List<LayoutComponent>> components()
      The message components.
      Returns:
      The value.
    • withPrivately

      public CommandReplySpec withPrivately(discord4j.discordjson.possible.Possible<Boolean> value)
    • withPrivately

      public CommandReplySpec withPrivately(Boolean value)
    • withContent

      public CommandReplySpec withContent(discord4j.discordjson.possible.Possible<String> value)
    • withContent

      public CommandReplySpec withContent(String value)
    • withTts

      public CommandReplySpec withTts(discord4j.discordjson.possible.Possible<Boolean> value)
    • withTts

      public CommandReplySpec withTts(Boolean value)
    • withEmbeds

      public CommandReplySpec withEmbeds(discord4j.discordjson.possible.Possible<List<EmbedCreateSpec>> possible)
    • withEmbeds

      public CommandReplySpec withEmbeds(Iterable<EmbedCreateSpec> elements)
    • withEmbeds

      @SafeVarargs public final CommandReplySpec withEmbeds(EmbedCreateSpec... elements)
    • withFiles

      public CommandReplySpec withFiles(MessageCreateFields.File... elements)
    • withFiles

      public CommandReplySpec withFiles(Iterable<? extends MessageCreateFields.File> elements)
    • withFileSpoilers

      public CommandReplySpec withFileSpoilers(MessageCreateFields.FileSpoiler... elements)
    • withFileSpoilers

      public CommandReplySpec withFileSpoilers(Iterable<? extends MessageCreateFields.FileSpoiler> elements)
    • withAllowedMentions

      public CommandReplySpec withAllowedMentions(discord4j.discordjson.possible.Possible<discord4j.rest.util.AllowedMentions> value)
    • withAllowedMentions

      public CommandReplySpec withAllowedMentions(discord4j.rest.util.AllowedMentions value)
    • withComponents

      public CommandReplySpec withComponents(discord4j.discordjson.possible.Possible<List<LayoutComponent>> possible)
    • withComponents

      public CommandReplySpec withComponents(Iterable<LayoutComponent> elements)
    • withComponents

      @SafeVarargs public final CommandReplySpec withComponents(LayoutComponent... elements)
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of CommandReplySpec that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: privately, content, tts, embeds, files, fileSpoilers, allowedMentions, components.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value CommandReplySpec with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • isPrivatelyPresent

      public boolean isPrivatelyPresent()
    • privatelyOrElse

      public Boolean privatelyOrElse(Boolean defaultValue)
    • isContentPresent

      public boolean isContentPresent()
    • contentOrElse

      public String contentOrElse(String defaultValue)
    • isTtsPresent

      public boolean isTtsPresent()
    • ttsOrElse

      public Boolean ttsOrElse(Boolean defaultValue)
    • isEmbedsPresent

      public boolean isEmbedsPresent()
    • embedsOrElse

      public List<EmbedCreateSpec> embedsOrElse(List<EmbedCreateSpec> defaultValue)
    • isAllowedMentionsPresent

      public boolean isAllowedMentionsPresent()
    • allowedMentionsOrElse

      public discord4j.rest.util.AllowedMentions allowedMentionsOrElse(discord4j.rest.util.AllowedMentions defaultValue)
    • isComponentsPresent

      public boolean isComponentsPresent()
    • componentsOrElse

      public List<LayoutComponent> componentsOrElse(List<LayoutComponent> defaultValue)
    • builder

      public static CommandReplySpec.Builder builder()
      Creates a builder for CommandReplySpec.
       CommandReplySpec.builder()
          .privately(discord4j.discordjson.possible.Possible&lt;Boolean&gt;) // privately
          .content(discord4j.discordjson.possible.Possible&lt;String&gt;) // content
          .tts(discord4j.discordjson.possible.Possible&lt;Boolean&gt;) // tts
          .embeds(discord4j.discordjson.possible.Possible&lt;List&lt;discord4j.core.spec.EmbedCreateSpec&gt;&gt;) // embeds
          .files(List&lt;discord4j.core.spec.MessageCreateFields.File&gt;) // files
          .fileSpoilers(List&lt;discord4j.core.spec.MessageCreateFields.FileSpoiler&gt;) // fileSpoilers
          .allowedMentions(discord4j.discordjson.possible.Possible&lt;discord4j.rest.util.AllowedMentions&gt;) // allowedMentions
          .components(discord4j.discordjson.possible.Possible&lt;List&lt;discord4j.core.object.component.LayoutComponent&gt;&gt;) // components
          .build();
       
      Returns:
      A new CommandReplySpec builder
    • toMessage

      @SideEffectFree default MessageCreateSpec toMessage()
      Converts this spec into a message spec.
      Returns:
      The converted spec.
    • toInteractionReply

      @SideEffectFree default InteractionApplicationCommandCallbackSpec toInteractionReply(boolean defaultPrivate)
      Converts this spec into an interaction reply spec.
      Parameters:
      defaultPrivate - Whether the reply should be private (ephemeral) by default (if not specified).
      Returns:
      The converted spec.
    • toInteractionFollowup

      @SideEffectFree default InteractionFollowupCreateSpec toInteractionFollowup(boolean defaultPrivate)
      Converts this spec into an interaction followup spec.
      Parameters:
      defaultPrivate - Whether the reply should be private (ephemeral) by default (if not specified).
      Returns:
      The converted spec.