Make trivia command defer reply

This commit is contained in:
Bea 2022-12-26 03:51:43 +01:00
parent 5acd900857
commit 3676e9d5ad

View File

@ -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);
});
}
}