Search code examples
discord-jda

JDA - Reply to slash event multiple times


I want to reply to a slash command with 2 separate messages because an emoji sent in the same message gets smaller when they are combined.

I want to do something like this:

event.reply(this.dadJokeReader()).queue();
event.reply(this.randomFunEmoji()).queue();

However, there is an error: This interaction has already been acknowledged or replied to. You can only reply or acknowledge an interaction once!

Is there a way I can send two separated messages but they still count as one reply?


Solution

  • I found a solution.

    event.reply(this.dadJokeReader()).queue();
    event.getHook().sendMessage(this.randomEmoji(this.generateFunEmoji())).queue();
    

    This way the second message will be a reply to the first one.