Skip to content

Commit

Permalink
fix: don't defer reply for null response
Browse files Browse the repository at this point in the history
  • Loading branch information
qixils committed Dec 22, 2023
1 parent 88dab3c commit 91befc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public static void consumeCommandResult(@NonNull CommandInteraction interaction,
case Mono<?> mono -> mono.subscribe(res -> consumeCommandResult(interaction, res));
case CompletableFuture<?> fut -> fut.thenAccept(res -> consumeCommandResult(interaction, res));
// terminal cases:
case null -> interaction.deferReply().queue();
case Boolean ephemeral -> interaction.deferReply(ephemeral).queue();
case null -> {}
case Boolean ephemeral -> interaction.deferReply(ephemeral).queue(); // TODO: replace with little enum class?
case QuasiMessage message -> message.text().asString(Context.fromInteraction(interaction)).subscribe(string -> {
var action = interaction.reply(string);
message.modifier().accept(action);
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/dev/qixils/quasicord/locale/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
* Stores information about the author and location of a message to determine the {@link Locale}
* to use for localizing response messages.
*/
// TODO: discord now exposes the user's selected locale in the slash command event object.
// this should be checked after the user config check but before the channel config check.
// TODO: discord also exposes the guild's locale! that should be checked after the guild config check.
// TODO: the interface should not be pseudo-mutable... it should be immutable with a mutable builder.
public interface Context {

Expand Down

0 comments on commit 91befc3

Please sign in to comment.