public final class AnnouncementChannelArgument extends Argument<A,T>
NewsChannel
Constructor and Description |
---|
AnnouncementChannelArgument(@NotNull String name,
@NotNull String prompt)
Creates an instance of this Argument implementation
|
Modifier and Type | Method and Description |
---|---|
AnnouncementChannelArgument |
clone()
An argument clone is required to prevent a value traveling through different Command calls.
|
@Nullable net.dv8tion.jda.api.entities.NewsChannel |
parse(@NotNull net.dv8tion.jda.api.events.message.MessageReceivedEvent event,
@NotNull String arg)
To be called if all validations passed.
|
net.dv8tion.jda.api.entities.NewsChannel |
parse(net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent event,
String arg)
To be called if all validations passed.
|
@Nullable String |
validate(@NotNull net.dv8tion.jda.api.events.message.MessageReceivedEvent event,
@NotNull String arg)
Validates if the argument input by the user is a valid value.
|
String |
validate(net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent event,
String arg)
Validates if the argument input by the user is a valid value.
|
addValidValues, clone, getDefaultValue, getMax, getMin, getName, getPrompt, getPrompt, getPromptRaw, getType, getValidValues, getValue, inRange, inRange, inRange, inRange, inRange, inRange, isRequired, oneOf, setDefaultValue, setDefaultValue, setMax, setMax, setMax, setMax, setMin, setMin, setMin, setMin, setPromptParser, setRequired, setSlashValue, setValue, validateNull
public AnnouncementChannelArgument(@NotNull @NotNull String name, @NotNull @NotNull String prompt)
name
- Readable name to display to the finalprompt
- Hint to indicate the user the expected value to be passed to this argument.@Nullable public @Nullable String validate(@NotNull @NotNull net.dv8tion.jda.api.events.message.MessageReceivedEvent event, @NotNull @NotNull String arg)
IArgument
event
- Discord event that triggered this function call.arg
- argument input by the user.public String validate(net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent event, String arg)
IArgument
event
- Discord event that triggered this function call.arg
- argument input by the user.@Nullable public @Nullable net.dv8tion.jda.api.entities.NewsChannel parse(@NotNull @NotNull net.dv8tion.jda.api.events.message.MessageReceivedEvent event, @NotNull @NotNull String arg)
IArgument
event
- Discord event that triggered this function call.arg
- argument input by the user.IArgument.validate(MessageReceivedEvent, String)
public net.dv8tion.jda.api.entities.NewsChannel parse(net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent event, String arg)
IArgument
event
- Discord event that triggered this function call.arg
- argument input by the user.IArgument.validate(MessageReceivedEvent, String)
public AnnouncementChannelArgument clone()
Argument
If your Argument child doesn't have additional attribute, you may just do
return clone(new MyArgument(getName(), getPrompt()));
clone
in interface IArgument<AnnouncementChannelArgument,net.dv8tion.jda.api.entities.NewsChannel>
clone
in class Argument<AnnouncementChannelArgument,net.dv8tion.jda.api.entities.NewsChannel>