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
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondiscord4j.discordjson.possible.Possible<discord4j.rest.util.AllowedMentions>
The allowed mentions.discord4j.rest.util.AllowedMentions
allowedMentionsOrElse
(discord4j.rest.util.AllowedMentions defaultValue) static CommandReplySpec.Builder
builder()
Creates a builder forCommandReplySpec
.discord4j.discordjson.possible.Possible<List<LayoutComponent>>
The message components.componentsOrElse
(List<LayoutComponent> defaultValue) discord4j.discordjson.possible.Possible<String>
content()
The reply message content.contentOrElse
(String defaultValue) discord4j.discordjson.possible.Possible<List<EmbedCreateSpec>>
embeds()
The reply embeds.embedsOrElse
(List<EmbedCreateSpec> defaultValue) boolean
This instance is equal to all instances ofCommandReplySpec
that have equal attribute values.files()
The attached files.The spoiler-tagged attached files.int
hashCode()
Computes a hash code from attributes:privately
,content
,tts
,embeds
,files
,fileSpoilers
,allowedMentions
,components
.boolean
boolean
boolean
boolean
boolean
boolean
discord4j.discordjson.possible.Possible<Boolean>
Whether to send the reply privately.privatelyOrElse
(Boolean defaultValue) default InteractionFollowupCreateSpec
toInteractionFollowup
(boolean defaultPrivate) Converts this spec into an interaction followup spec.toInteractionReply
(boolean defaultPrivate) Converts this spec into an interaction reply spec.default MessageCreateSpec
Converts this spec into a message spec.toString()
Prints the immutable valueCommandReplySpec
with attribute values.discord4j.discordjson.possible.Possible<Boolean>
tts()
Whether the reply should use TTS.withAllowedMentions
(discord4j.discordjson.possible.Possible<discord4j.rest.util.AllowedMentions> value) withAllowedMentions
(discord4j.rest.util.AllowedMentions value) final CommandReplySpec
withComponents
(LayoutComponent... elements) withComponents
(discord4j.discordjson.possible.Possible<List<LayoutComponent>> possible) withComponents
(Iterable<LayoutComponent> elements) withContent
(discord4j.discordjson.possible.Possible<String> value) withContent
(String value) final CommandReplySpec
withEmbeds
(EmbedCreateSpec... elements) withEmbeds
(discord4j.discordjson.possible.Possible<List<EmbedCreateSpec>> possible) withEmbeds
(Iterable<EmbedCreateSpec> elements) withFiles
(MessageCreateFields.File... elements) withFiles
(Iterable<? extends MessageCreateFields.File> elements) withFileSpoilers
(MessageCreateFields.FileSpoiler... elements) withFileSpoilers
(Iterable<? extends MessageCreateFields.FileSpoiler> elements) withPrivately
(discord4j.discordjson.possible.Possible<Boolean> value) withPrivately
(Boolean value)
-
Method Details
-
privately
Whether to send the reply privately. If absent, the default for the command should be used.- Returns:
- The value.
-
content
The reply message content.- Returns:
- The value.
-
tts
Whether the reply should use TTS.- Returns:
- The value.
-
embeds
The reply embeds.- Returns:
- The value.
-
files
The attached files.- Returns:
- The value.
-
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
The message components.- Returns:
- The value.
-
withPrivately
-
withPrivately
-
withContent
-
withContent
-
withTts
-
withTts
-
withEmbeds
public CommandReplySpec withEmbeds(discord4j.discordjson.possible.Possible<List<EmbedCreateSpec>> possible) -
withEmbeds
-
withEmbeds
-
withFiles
-
withFiles
-
withFileSpoilers
-
withFileSpoilers
public CommandReplySpec withFileSpoilers(Iterable<? extends MessageCreateFields.FileSpoiler> elements) -
withAllowedMentions
public CommandReplySpec withAllowedMentions(discord4j.discordjson.possible.Possible<discord4j.rest.util.AllowedMentions> value) -
withAllowedMentions
-
withComponents
public CommandReplySpec withComponents(discord4j.discordjson.possible.Possible<List<LayoutComponent>> possible) -
withComponents
-
withComponents
-
equals
This instance is equal to all instances ofCommandReplySpec
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:privately
,content
,tts
,embeds
,files
,fileSpoilers
,allowedMentions
,components
. -
toString
Prints the immutable valueCommandReplySpec
with attribute values. -
isPrivatelyPresent
public boolean isPrivatelyPresent() -
privatelyOrElse
-
isContentPresent
public boolean isContentPresent() -
contentOrElse
-
isTtsPresent
public boolean isTtsPresent() -
ttsOrElse
-
isEmbedsPresent
public boolean isEmbedsPresent() -
embedsOrElse
-
isAllowedMentionsPresent
public boolean isAllowedMentionsPresent() -
allowedMentionsOrElse
public discord4j.rest.util.AllowedMentions allowedMentionsOrElse(discord4j.rest.util.AllowedMentions defaultValue) -
isComponentsPresent
public boolean isComponentsPresent() -
componentsOrElse
-
builder
Creates a builder forCommandReplySpec
.CommandReplySpec.builder() .privately(discord4j.discordjson.possible.Possible<Boolean>) //
privately
.content(discord4j.discordjson.possible.Possible<String>) //content
.tts(discord4j.discordjson.possible.Possible<Boolean>) //tts
.embeds(discord4j.discordjson.possible.Possible<List<discord4j.core.spec.EmbedCreateSpec>>) //embeds
.files(List<discord4j.core.spec.MessageCreateFields.File>) //files
.fileSpoilers(List<discord4j.core.spec.MessageCreateFields.FileSpoiler>) //fileSpoilers
.allowedMentions(discord4j.discordjson.possible.Possible<discord4j.rest.util.AllowedMentions>) //allowedMentions
.components(discord4j.discordjson.possible.Possible<List<discord4j.core.object.component.LayoutComponent>>) //components
.build();- Returns:
- A new CommandReplySpec builder
-
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
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.
-