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 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 JDA instance.
    • getCommandName

      public String getCommandName()
    • getAliases

      public List<String> getAliases()
    • getLogger

      protected org.slf4j.Logger getLogger()
      Retrieves the logger instance for the current command.
      Returns:
      The Logger instance.
    • handle

      public void handle(net.dv8tion.jda.api.events.message.MessageReceivedEvent event, String[] args, CommandReplyConfig replyConfig)
      Description copied from interface: ITextCommand
      Handles the incoming text command interaction.
      Specified by:
      handle in interface ITextCommand
      Parameters:
      event - The MessageReceivedEvent triggered 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 valid MessageReceivedEvent.
      args - The parsed command arguments.