We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0bad5db commit 304fc66Copy full SHA for 304fc66
application/src/main/java/org/togetherjava/tjbot/features/basic/ApplicationCreateCommand.java
@@ -119,7 +119,13 @@ public void onSlashCommand(SlashCommandInteractionEvent event) {
119
return;
120
}
121
122
- long incorrectArgsCount = getIncorrectRoleArgsCount(event.getInteraction().getOptions());
+ final List<OptionMapping> optionMappings = event.getInteraction().getOptions();
123
+ if (optionMappings.isEmpty()) {
124
+ event.reply("You have to select at least one role.").setEphemeral(true).queue();
125
+ return;
126
+ }
127
+
128
+ long incorrectArgsCount = getIncorrectRoleArgsCount(optionMappings);
129
if (incorrectArgsCount > 0) {
130
event.reply("Missing information for %d roles.".formatted(incorrectArgsCount))
131
.setEphemeral(true)
0 commit comments