Class CommandReplySpec.Builder
java.lang.Object
dev.sympho.modular_commands.api.command.reply.CommandReplySpec.Builder
- Enclosing class:
- CommandReplySpec
Builds instances of type
CommandReplySpec.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionaddAllComponents(List<LayoutComponent> elements) addAllEmbeds(List<EmbedCreateSpec> elements) addAllFiles(Iterable<? extends MessageCreateFields.File> files) addAllFileSpoilers(Iterable<? extends MessageCreateFields.FileSpoiler> files) addComponent(LayoutComponent element) addEmbed(EmbedCreateSpec element) addFile(MessageCreateFields.File... files) allowedMentions(discord4j.discordjson.possible.Possible<discord4j.rest.util.AllowedMentions> value) allowedMentions(discord4j.rest.util.AllowedMentions value) build()Builds a newCommandReplySpec.components(discord4j.discordjson.possible.Possible<List<LayoutComponent>> elements) components(Iterable<LayoutComponent> elements) components(List<LayoutComponent> elements) embeds(discord4j.discordjson.possible.Possible<List<EmbedCreateSpec>> elements) embeds(Iterable<EmbedCreateSpec> elements) embeds(List<EmbedCreateSpec> elements) files(Iterable<? extends MessageCreateFields.File> files) fileSpoilers(Iterable<? extends MessageCreateFields.FileSpoiler> files) final CommandReplySpec.Builderfrom(CommandReplySpec instance) Fill a builder with attribute values from the providedCommandReplySpecinstance.
-
Method Details
-
from
Fill a builder with attribute values from the providedCommandReplySpecinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
privately
@CanIgnoreReturnValue public CommandReplySpec.Builder privately(discord4j.discordjson.possible.Possible<Boolean> value) -
privately
-
content
@CanIgnoreReturnValue public CommandReplySpec.Builder content(discord4j.discordjson.possible.Possible<String> value) -
content
-
tts
@CanIgnoreReturnValue public CommandReplySpec.Builder tts(discord4j.discordjson.possible.Possible<Boolean> value) -
tts
-
addEmbed
-
addAllEmbeds
-
embeds
@CanIgnoreReturnValue public CommandReplySpec.Builder embeds(discord4j.discordjson.possible.Possible<List<EmbedCreateSpec>> elements) -
embeds
-
embeds
-
files
@CanIgnoreReturnValue public CommandReplySpec.Builder files(Iterable<? extends MessageCreateFields.File> files) -
addFile
-
addAllFiles
@CanIgnoreReturnValue public CommandReplySpec.Builder addAllFiles(Iterable<? extends MessageCreateFields.File> files) -
fileSpoilers
@CanIgnoreReturnValue public CommandReplySpec.Builder fileSpoilers(Iterable<? extends MessageCreateFields.FileSpoiler> files) -
addFileSpoiler
@CanIgnoreReturnValue public CommandReplySpec.Builder addFileSpoiler(MessageCreateFields.FileSpoiler... files) -
addAllFileSpoilers
@CanIgnoreReturnValue public CommandReplySpec.Builder addAllFileSpoilers(Iterable<? extends MessageCreateFields.FileSpoiler> files) -
allowedMentions
@CanIgnoreReturnValue public CommandReplySpec.Builder allowedMentions(discord4j.discordjson.possible.Possible<discord4j.rest.util.AllowedMentions> value) -
allowedMentions
@CanIgnoreReturnValue public CommandReplySpec.Builder allowedMentions(discord4j.rest.util.AllowedMentions value) -
addComponent
-
addAllComponents
@CanIgnoreReturnValue public CommandReplySpec.Builder addAllComponents(List<LayoutComponent> elements) -
components
@CanIgnoreReturnValue public CommandReplySpec.Builder components(discord4j.discordjson.possible.Possible<List<LayoutComponent>> elements) -
components
-
components
@CanIgnoreReturnValue public CommandReplySpec.Builder components(Iterable<LayoutComponent> elements) -
build
Builds a newCommandReplySpec.- Returns:
- An immutable instance of CommandReplySpec
- Throws:
IllegalStateException- if any required attributes are missing
-