Skip to content

Commit 75f4fd2

Browse files
Display error message when passing multiple option arguments to /help
1 parent a299dca commit 75f4fd2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/technobot/commands/utility/HelpCommand.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ public void execute(SlashCommandInteractionEvent event) {
5757

5858
OptionMapping option = event.getOption("category");
5959
OptionMapping option2 = event.getOption("command");
60-
if (option != null) {
60+
if (option != null && option2 != null) {
61+
event.replyEmbeds(EmbedUtils.createError("Please only give one optional argument and try again.")).queue();
62+
} else if (option != null) {
6163
// Display category commands menu
6264
Category category = Category.valueOf(option.getAsString().toUpperCase());
6365
List<MessageEmbed> embeds = buildCategoryMenu(category, categories.get(category));

0 commit comments

Comments
 (0)