tech.xigam.cch.command.Alias Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of CCH Show documentation
Show all versions of CCH Show documentation
A really useful and simple command handler for JDA.
package tech.xigam.cch.command;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.events.interaction.command.CommandAutoCompleteInteractionEvent;
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
import net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent;
import tech.xigam.cch.ComplexCommandHandler;
import tech.xigam.cch.utils.Interaction;
import java.util.List;
public record Alias(String label, Command aliasOf) implements BaseCommand
{
@Override
public String getLabel() {
return this.label;
}
@Override
public String getDescription() {
return this.aliasOf.getDescription();
}
@Override
public void execute(Interaction interaction) {
aliasOf.execute(interaction);
}
@Override
public void prepareForExecution(SlashCommandInteractionEvent event, ComplexCommandHandler handler) {
aliasOf.prepareForExecution(event, handler);
}
@Override
public void prepareForExecution(List arguments, Message message, Member sender, TextChannel channel, boolean skipArguments, ComplexCommandHandler handler) {
aliasOf.prepareForExecution(arguments, message, sender, channel, skipArguments, handler);
}
@Override
public void prepareForCompletion(CommandAutoCompleteInteractionEvent event, ComplexCommandHandler handler) {
aliasOf.prepareForCompletion(event, handler);
}
@Override
public void prepareForCallback(String cmdLabel, ButtonInteractionEvent event, ComplexCommandHandler handler) {
aliasOf.prepareForCallback(cmdLabel, event, handler);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy