Package com.dianxin.tori.api.commands
Class TextCommandRegistrar
java.lang.Object
com.dianxin.tori.api.commands.TextCommandRegistrar
@Obsolete(since="Discord Message Content Intent restrictions")
public class TextCommandRegistrar
extends Object
The registrar for legacy text-based commands.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonEvent(@NotNull net.dv8tion.jda.api.events.message.MessageReceivedEvent event) Handles the incoming message event, parses the command, and delegates execution.register(@NotNull BaseTextCommand... cmds) Registers statically configured base text commands.register(@NotNull ModernBaseTextCommand... cmds) Registers annotation-driven modern text commands.setReplyConfig(CommandReplyConfig config) Sets the reply configuration for permission denials.
-
Constructor Details
-
TextCommandRegistrar
Constructs a new TextCommandRegistrar.- Parameters:
prefix- The prefix used to trigger commands (e.g., "!").
-
-
Method Details
-
setReplyConfig
Sets the reply configuration for permission denials.- Parameters:
config- The newCommandReplyConfig.- Returns:
- This registrar instance.
-
register
Registers statically configured base text commands.- Parameters:
cmds- The commands to register.- Returns:
- This registrar instance.
-
register
Registers annotation-driven modern text commands.- Parameters:
cmds- The commands to register.- Returns:
- This registrar instance.
-
onEvent
public void onEvent(@NotNull @NotNull net.dv8tion.jda.api.events.message.MessageReceivedEvent event) Handles the incoming message event, parses the command, and delegates execution.- Parameters:
event- TheMessageReceivedEvent.
-