Skip to content

Commit 7426b94

Browse files
Merge pull request #342 from Java-Discord/moon/help-ping-fix
Moved /help-guidelines and /help-ping to /help
2 parents 7920d0c + d11e17a commit 7426b94

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/main/java/net/javadiscord/javabot/systems/help/commands/HelpCommand.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33
import com.dynxsty.dih4jda.interactions.commands.SlashCommand;
44
import net.dv8tion.jda.api.interactions.commands.build.Commands;
55
import net.javadiscord.javabot.systems.help.commands.subcommands.HelpAccountSubcommand;
6+
import net.javadiscord.javabot.systems.help.commands.subcommands.HelpGuidelinesCommand;
7+
import net.javadiscord.javabot.systems.help.commands.subcommands.HelpPingCommand;
68

79
/**
8-
* Represents the `/help` command. This holds commands for a user's Help Account.
10+
* Represents the `/help` command. This holds commands related to the help system.
911
*/
1012
public class HelpCommand extends SlashCommand {
1113
/**
1214
* The constructor of this class, which sets the corresponding {@link net.dv8tion.jda.api.interactions.commands.build.SlashCommandData}.
1315
*/
1416
public HelpCommand() {
15-
setSlashCommandData(Commands.slash("help", "Commands for managing your Help Account.")
17+
setSlashCommandData(Commands.slash("help", "Commands related to the help system.")
1618
.setGuildOnly(true)
1719
);
18-
addSubcommands(new HelpAccountSubcommand());
20+
addSubcommands(new HelpAccountSubcommand(), new HelpPingCommand(), new HelpGuidelinesCommand());
1921
}
2022
}

src/main/java/net/javadiscord/javabot/systems/help/commands/HelpGuidelinesCommand.java renamed to src/main/java/net/javadiscord/javabot/systems/help/commands/subcommands/HelpGuidelinesCommand.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package net.javadiscord.javabot.systems.help.commands;
1+
package net.javadiscord.javabot.systems.help.commands.subcommands;
22

33
import com.dynxsty.dih4jda.interactions.commands.SlashCommand;
44
import net.dv8tion.jda.api.EmbedBuilder;
55
import net.dv8tion.jda.api.entities.GuildChannel;
66
import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent;
7-
import net.dv8tion.jda.api.interactions.commands.build.Commands;
7+
import net.dv8tion.jda.api.interactions.commands.build.SubcommandData;
88
import net.javadiscord.javabot.Bot;
99
import net.javadiscord.javabot.data.config.guild.HelpConfig;
1010
import net.javadiscord.javabot.util.Responses;
@@ -16,14 +16,12 @@
1616
/**
1717
* Shows the server's help-guidelines.
1818
*/
19-
public class HelpGuidelinesCommand extends SlashCommand {
19+
public class HelpGuidelinesCommand extends SlashCommand.Subcommand {
2020
/**
2121
* The constructor of this class, which sets the corresponding {@link net.dv8tion.jda.api.interactions.commands.build.SlashCommandData}.
2222
*/
2323
public HelpGuidelinesCommand() {
24-
setSlashCommandData(Commands.slash("help-guidelines", "Show the server's help guidelines in a simple format.")
25-
.setGuildOnly(true)
26-
);
24+
setSubcommandData(new SubcommandData("guidelines", "Show the server's help guidelines in a simple format."));
2725
}
2826

2927
@Override

src/main/java/net/javadiscord/javabot/systems/help/commands/HelpPingCommand.java renamed to src/main/java/net/javadiscord/javabot/systems/help/commands/subcommands/HelpPingCommand.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package net.javadiscord.javabot.systems.help.commands;
1+
package net.javadiscord.javabot.systems.help.commands.subcommands;
22

33
import com.dynxsty.dih4jda.interactions.commands.SlashCommand;
44
import net.dv8tion.jda.api.EmbedBuilder;
@@ -19,7 +19,7 @@
1919
import java.util.concurrent.TimeUnit;
2020

2121
/**
22-
* Handler for the /help-ping command that allows users to occasionally ping
22+
* Handler for the /help ping sub-command that allows users to occasionally ping
2323
* helpers.
2424
*/
2525
public class HelpPingCommand extends SlashCommand.Subcommand {
@@ -32,7 +32,7 @@ public class HelpPingCommand extends SlashCommand.Subcommand {
3232
* Constructor that initializes and handles the cooldown map.
3333
*/
3434
public HelpPingCommand() {
35-
setSubcommandData(new SubcommandData("help-ping", "Notify those with the help-ping role that your question is urgent."));
35+
setSubcommandData(new SubcommandData("ping", "Notify those with the help-ping role that your question is urgent."));
3636
lastPingTimes = new ConcurrentHashMap<>();
3737
Bot.getAsyncPool().scheduleWithFixedDelay(this::cleanTimeoutCache, CACHE_CLEANUP_DELAY, CACHE_CLEANUP_DELAY, TimeUnit.SECONDS);
3838
}

0 commit comments

Comments
 (0)