File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/main/java/com/javadiscord/javabot Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 3131import static net .dv8tion .jda .api .interactions .commands .OptionType .USER ;
3232
3333public class SlashCommands extends ListenerAdapter {
34+ /**
35+ * Maps every command name and alias to an instance of the command, for
36+ * constant-time lookup.
37+ */
3438 private final Map <String , SlashEnabledCommand > commandsIndex ;
3539
3640 public SlashCommands (CommandClient commandClient ) {
@@ -89,10 +93,6 @@ public void onSlashCommand(SlashCommandEvent event) {
8993 Lmgtfy .exCommand (event , event .getOption ("text" ).getAsString ());
9094 break ;
9195
92- case "ping" :
93- new Ping ().execute (event );
94- break ;
95-
9696 case "profile" :
9797
9898 OptionMapping profileOption = event .getOption ("user" );
@@ -117,6 +117,10 @@ public void onSlashCommand(SlashCommandEvent event) {
117117 }
118118 }
119119
120+ /**
121+ * Registers all slash commands in the command index.
122+ * @param commandClient The command client to register commands from.
123+ */
120124 private void registerSlashCommands (CommandClient commandClient ) {
121125 for (var cmd : commandClient .getCommands ()) {
122126 if (cmd instanceof SlashEnabledCommand ) {
You can’t perform that action at this time.
0 commit comments