Skip to content

Commit

Permalink
Fix resolve wrong
Browse files Browse the repository at this point in the history
Signed-off-by: shedaniel <daniel@shedaniel.me>
  • Loading branch information
shedaniel committed Jun 7, 2022
1 parent e56b7f5 commit eae4c88
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ class SlashCommands(
if (!executeOptions(command, ctx, optionsGetter, command.options, event.options) && !command.execute(command, ctx, optionsGetter)) {
}
}, executor).orTimeout(10, TimeUnit.SECONDS)
.thenAccept {
if (!sentAny) {
throw IllegalStateException("Command was not resolved!")
}
}
.exceptionally {
it.let { throwable ->
if (throwable is TimeoutException) {
Expand All @@ -329,9 +334,6 @@ class SlashCommands(
null
}
.join()
if (!sentAny) {
throw IllegalStateException("Command was not resolved!")
}
}, autoCompleter = { event ->
val optionsGetter = WeakOptionsGetter.of(command, event).asSuggestion(event.commandName)
var options: List<ApplicationCommandOptionChoiceData>? = null
Expand Down

0 comments on commit eae4c88

Please # to comment.