#Keep getting Unknown Message on route: ButtonInteraction.editReply()

28 messages · Page 1 of 1 (latest)

crystal agate
scarlet juncoBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

crystal agate
#

node -v: v20.0

#

This is the line on the stack trace which errors:

        collector.on("end", async (collected, reason) => {
            if (reason === "time") {
                await interaction.editReply({ //here
                    embeds: [
                        EmbedBuilder.from(
                            interaction.message.embeds[0]
                        ).setDescription("You ran out of time"),
                    ],
                    components: [],
                });
            }
        });

But I have added a catch here with better logs. But I can't reproduce the error well enough:

        collector.on("end", async (collected, reason) => {
            if (reason === "time") {
                await interaction.editReply({
                    embeds: [
                        EmbedBuilder.from(
                            interaction.message.embeds[0]
                        ).setDescription("You ran out of time"),
                    ],
                    components: [],
                }).catch((err) => {
                    console.log('The ticket module errored!');
                    console.log(err);
                    console.log(collected, reason)
                })
            }
        });
dense tapir
#

don't you mean to use collected instead of interaction?

crystal agate
#

No

#

Actually

#

That's a good point

#

interaction in this case would be my main <ButtonInteraction> coming from my button to begin with, which I do deferReply() at the top so I don't think that should be an issue

dense tapir
#

but you already edit the reply

crystal agate
#

You can editReply how ever many times you want

#

Gotta be within 15 mins ofc

#

Which this is

#

Unknown interaction and Unknown message is different mate

wooden mason
#

ooh sorry I will post it in related chat

crystal agate
#

No worries man

wooden mason
#

thanks

ashen scroll
#

That original interaction‘s reply simply doesn’t exist anymore. Was it ephemeral?

crystal agate
#

It was yes

#

So maybe if it ends with time but someone deleted the reply it still tries to edit?

ashen scroll
#

Then the use can dismiss it any time they want and it‘ll be gone

crystal agate
#

And I guess we can't tell if someone deletes an interaction response which is ephemeral either right?

#

Should I just catch and ignore it if it errors, or should I do something else?

ashen scroll
crystal agate
#

Only trying and failing

#

As I can't reproduce this, that's all