From 3676e9d5ada7f492edd5cad4d884df458a5af8c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Mon, 26 Dec 2022 03:51:43 +0100 Subject: [PATCH] Make trivia command defer reply --- .../hidekobot/commands/slash/TriviaCommand.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/wtf/beatrice/hidekobot/commands/slash/TriviaCommand.java b/src/main/java/wtf/beatrice/hidekobot/commands/slash/TriviaCommand.java index a18f4dd..819a50f 100644 --- a/src/main/java/wtf/beatrice/hidekobot/commands/slash/TriviaCommand.java +++ b/src/main/java/wtf/beatrice/hidekobot/commands/slash/TriviaCommand.java @@ -38,14 +38,14 @@ public class TriviaCommand extends SlashCommandImpl return; } + // if we got here, this might take a bit + event.deferReply().queue(); MessageResponse response = Trivia.generateMainScreen(); - event.replyEmbeds(response.embed()).addActionRow(response.components()).queue(interaction -> + event.getHook().editOriginalEmbeds(response.embed()).setActionRow(response.components()).queue(message -> { - interaction.retrieveOriginal().queue(message -> { - Cache.getDatabaseSource().trackRanCommandReply(message, event.getUser()); - Cache.getDatabaseSource().queueDisabling(message); - }); + Cache.getDatabaseSource().trackRanCommandReply(message, event.getUser()); + Cache.getDatabaseSource().queueDisabling(message); }); } }