Skip to content

Commit 00df7e2

Browse files
committed
Added some javadoc.
1 parent 8a0d5e7 commit 00df7e2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main/java/com/javadiscord/javabot/SlashCommands.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
import static net.dv8tion.jda.api.interactions.commands.OptionType.USER;
3232

3333
public 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) {

0 commit comments

Comments
 (0)