Class ModernBaseTextCommand

java.lang.Object
com.dianxin.tori.api.commands.text.ModernBaseTextCommand
All Implemented Interfaces:
ITextCommand

@Obsolete(since="Discord Message Content Intent restrictions") public abstract class ModernBaseTextCommand extends Object implements ITextCommand
An annotation-driven base class for legacy text commands.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ModernBaseTextCommand(net.dv8tion.jda.api.JDA jda, IBotMeta meta)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    execute(net.dv8tion.jda.api.events.message.MessageReceivedEvent event, String[] args)
    The core execution logic of the text command.
    protected net.dv8tion.jda.api.JDA
    Retrieves the JDA instance associated with this command.
    protected org.slf4j.Logger
    Retrieves the logger instance for the current command.
    final void
    handle(net.dv8tion.jda.api.events.message.MessageReceivedEvent event, String[] args, CommandReplyConfig replyConfig)
    Handles the incoming text command interaction.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ModernBaseTextCommand

      public ModernBaseTextCommand(net.dv8tion.jda.api.JDA jda, IBotMeta meta)
  • Method Details

    • getLogger

      protected org.slf4j.Logger getLogger()
      Retrieves the logger instance for the current command. * @return The Logger instance.
    • getJda

      protected net.dv8tion.jda.api.JDA getJda()
      Retrieves the JDA instance associated with this command. * @return The JDA instance.
    • handle

      public final 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.