Class BaseTextCommand
java.lang.Object
com.dianxin.tori.api.commands.text.BaseTextCommand
- All Implemented Interfaces:
ITextCommand
@Obsolete(since="Discord Message Content Intent restrictions")
public abstract class BaseTextCommand
extends Object
implements ITextCommand
A statically configured base class for legacy text commands.
-
Constructor Summary
ConstructorsConstructorDescriptionBaseTextCommand(String title, List<String> aliases, net.dv8tion.jda.api.JDA jda, IBotMeta meta, boolean guildOnly, boolean ownerOnly, boolean privateChannelOnly, boolean directMessageOnly, List<net.dv8tion.jda.api.Permission> permissionsRequired, List<net.dv8tion.jda.api.Permission> selfPermissionsRequired, boolean isDebug) BaseTextCommand(String title, List<String> aliases, net.dv8tion.jda.api.JDA jda, IBotMeta meta, LegacyCommandBuilder builder) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidThe core execution logic of the text command.protected net.dv8tion.jda.api.JDAgetJda()Retrieves the JDA instance associated with this command.protected org.slf4j.LoggerRetrieves the logger instance for the current command.voidhandle(net.dv8tion.jda.api.events.message.MessageReceivedEvent event, String[] args, CommandReplyConfig replyConfig) Handles the incoming text command interaction.
-
Constructor Details
-
BaseTextCommand
public BaseTextCommand(String title, List<String> aliases, net.dv8tion.jda.api.JDA jda, IBotMeta meta, boolean guildOnly, boolean ownerOnly, boolean privateChannelOnly, boolean directMessageOnly, List<net.dv8tion.jda.api.Permission> permissionsRequired, List<net.dv8tion.jda.api.Permission> selfPermissionsRequired, boolean isDebug) -
BaseTextCommand
public BaseTextCommand(String title, List<String> aliases, net.dv8tion.jda.api.JDA jda, IBotMeta meta, LegacyCommandBuilder builder)
-
-
Method Details
-
getJda
protected net.dv8tion.jda.api.JDA getJda()Retrieves the JDA instance associated with this command.- Returns:
- The
JDAinstance.
-
getCommandName
-
getAliases
-
getLogger
protected org.slf4j.Logger getLogger()Retrieves the logger instance for the current command.- Returns:
- The
Loggerinstance.
-
handle
public void handle(net.dv8tion.jda.api.events.message.MessageReceivedEvent event, String[] args, CommandReplyConfig replyConfig) Description copied from interface:ITextCommandHandles the incoming text command interaction.- Specified by:
handlein interfaceITextCommand- Parameters:
event- TheMessageReceivedEventtriggered by Discord.args- An array of arguments parsed from the message.replyConfig- The configuration used for custom error or rejection messages.
-
execute
protected abstract void execute(net.dv8tion.jda.api.events.message.MessageReceivedEvent event, String[] args) The core execution logic of the text command.- Parameters:
event- The validMessageReceivedEvent.args- The parsed command arguments.
-