I have an embed that needs to be updated and then a reply should trigger afterwards. The code takes about 5 seconds to complete so to prevent UnknownInteraction error, I added deferReply(). However, I can't get it to work.
Here's the exact flow:
I used update on #2 step, and editReply or followUp on #3 but to no avail.
I'm receiving Error [InteractionAlreadyReplied]: The reply to this interaction has already been sent or deferred. error on these 2 attempts:
Attempt 1
await interaction.deferReply();
await wait(5_000);
embed1 = embed1content;
embed2 = embed2content;
await interaction.update({ embeds: [embed1] });
interaction.followUp({ embeds: [embed2] });
Attempt 2
await interaction.deferReply();
await wait(5_000);
embed1 = embed1content;
embed2 = embed2content;
await interaction.update({ embeds: [embed1] });
interaction.editReply({ embeds: [embed2] });
This is what I did to resolve this.
await interaction.deferReply();
await wait(5_000);
embed1 = embed1content;
embed2 = embed2content;
await interaction.message.edit({ embeds: [embed1] });
interaction.editReply({ embeds: [embed2] });