Class TextCommandRegistrar

java.lang.Object
com.dianxin.tori.api.commands.TextCommandRegistrar

@ReleasedSince("26.4.234") @Deprecated @ScheduledForRemoval(inVersion="26.10.0") @Obsolete(since="Discord Message Content Intent restrictions") public class TextCommandRegistrar extends Object
Deprecated.
Discord is shifting toward Slash Commands to improve user privacy, security, and discoverability. So we need to deprecate any text command classes to align with Discord's requirements. It is recommended to use Slash command registrars for better experience.
The registrar for legacy text-based commands.
  • Constructor Details

    • TextCommandRegistrar

      public TextCommandRegistrar(String prefix)
      Deprecated.
      Constructs a new TextCommandRegistrar.
      Parameters:
      prefix - The prefix used to trigger commands (e.g., "!").
  • Method Details

    • setReplyConfig

      public TextCommandRegistrar setReplyConfig(CommandReplyConfig config)
      Deprecated.
      Sets the reply configuration for permission denials.
      Parameters:
      config - The new CommandReplyConfig.
      Returns:
      This registrar instance.
    • register

      public TextCommandRegistrar register(@NotNull @NotNull BaseTextCommand... cmds)
      Deprecated.
      Registers statically configured base text commands.
      Parameters:
      cmds - The commands to register.
      Returns:
      This registrar instance.
    • register

      public TextCommandRegistrar register(@NotNull @NotNull ModernBaseTextCommand... cmds)
      Deprecated.
      Registers annotation-driven modern text commands.
      Parameters:
      cmds - The commands to register.
      Returns:
      This registrar instance.
    • onEvent

      public void onEvent(@NotNull @NotNull MessageReceivedEvent event)
      Deprecated.
      Handles the incoming message event, parses the command, and delegates execution.
      Parameters:
      event - The MessageReceivedEvent.