This commit is contained in:
@@ -9,10 +9,14 @@ public enum CommandCategory
|
||||
;
|
||||
|
||||
private String emoji;
|
||||
|
||||
CommandCategory(String emoji)
|
||||
{
|
||||
this.emoji = emoji;
|
||||
}
|
||||
|
||||
public String getEmoji() { return emoji; }
|
||||
public String getEmoji()
|
||||
{
|
||||
return emoji;
|
||||
}
|
||||
}
|
||||
|
@@ -70,12 +70,10 @@ public interface MessageCommand
|
||||
*
|
||||
* @param event the received message event. It should not be used for parsing message contents data as
|
||||
* the arguments already account for it in a better way.
|
||||
*
|
||||
* @param label the command label that was used, taken from all available command aliases.
|
||||
*
|
||||
* @param args a pre-formatted list of arguments, excluding the bot prefix and the command name.
|
||||
* This is useful because command logic won't have to change in case the bot prefix is changed,
|
||||
* removed, or we switch to another method of triggering commands (ping, trigger words, ...).
|
||||
* @param args a pre-formatted list of arguments, excluding the bot prefix and the command name.
|
||||
* This is useful because command logic won't have to change in case the bot prefix is changed,
|
||||
* removed, or we switch to another method of triggering commands (ping, trigger words, ...).
|
||||
*/
|
||||
void runCommand(MessageReceivedEvent event, String label, String[] args);
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@ public interface SlashArgumentsCompleter
|
||||
* @return the command object.
|
||||
*/
|
||||
SlashCommand getCommand();
|
||||
|
||||
/**
|
||||
* Run the argument-completion logic by parsing the event and replying accordingly.
|
||||
*
|
||||
|
@@ -6,13 +6,16 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class SlashArgumentsCompleterImpl implements SlashArgumentsCompleter
|
||||
{
|
||||
private final SlashCommand parentCommand;
|
||||
|
||||
public SlashArgumentsCompleterImpl(SlashCommand parentCommand)
|
||||
{
|
||||
this.parentCommand = parentCommand;
|
||||
}
|
||||
|
||||
public SlashCommand getCommand()
|
||||
{ return parentCommand; }
|
||||
{
|
||||
return parentCommand;
|
||||
}
|
||||
|
||||
public void runCompletion(@NotNull CommandAutoCompleteInteractionEvent event)
|
||||
{
|
||||
|
@@ -21,6 +21,7 @@ public interface SlashCommand
|
||||
* @return the command data object.
|
||||
*/
|
||||
CommandData getSlashCommandData();
|
||||
|
||||
/**
|
||||
* Run the command logic by parsing the event and replying accordingly.
|
||||
*
|
||||
|
@@ -8,17 +8,20 @@ public class SlashCommandImpl implements SlashCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
public String getCommandName()
|
||||
{
|
||||
return getSlashCommandData().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommandData getSlashCommandData() {
|
||||
public CommandData getSlashCommandData()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runSlashCommand(@NotNull SlashCommandInteractionEvent event) {
|
||||
public void runSlashCommand(@NotNull SlashCommandInteractionEvent event)
|
||||
{
|
||||
event.reply("Base command implementation").queue();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user