Finish command completion listener implementation
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Very similarly to how the slash command interface works, now a slash command auto-completion interface also exists, with its respective listener.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package wtf.beatrice.hidekobot.objects.commands;
|
||||
|
||||
import net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface SlashArgumentsCompleter
|
||||
{
|
||||
|
||||
/**
|
||||
* Get the parent slash command's object.
|
||||
*
|
||||
* @return the command object.
|
||||
*/
|
||||
SlashCommand getCommand();
|
||||
/**
|
||||
* Run the argument-completion logic by parsing the event and replying accordingly.
|
||||
*
|
||||
* @param event the received auto-complete event.
|
||||
*/
|
||||
void runCompletion(@NotNull CommandAutoCompleteInteractionEvent event);
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
package wtf.beatrice.hidekobot.objects.commands;
|
||||
|
||||
import net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent;
|
||||
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; }
|
||||
|
||||
public void runCompletion(@NotNull CommandAutoCompleteInteractionEvent event)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user