#Edit followUp interaction

31 messages · Page 1 of 1 (latest)

waxen quest
#

I am trying to edit a followUp interaction but when I use editReply always is edited the first reply of interaction, not the followUp. Is there some way to edit followUp?

rocky grove
#

• 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.

waxen quest
#

Discord.js: v14.5.0
Node.js: v16.16.0

agile tartan
#

update djs to 14.7.1 and editReply accepts a MessageResolvable under the message option which you can get from resolving the returned promise from followUp

waxen quest
#

I am going to try it

waxen quest
#

Now how can i edit it? i don´t understand

agile tartan
#

take a look at the possible options

waxen quest
waxen quest
agile tartan
#

attemptEmbedReply is a Message instance

waxen quest
#

Then how can i do it?

waxen quest
# agile tartan .

In the documentation I only see that exists fetchReply and editReply

tribal thicket
#

Look at the options of editReply

waxen quest
tribal thicket
#

It's right there...?

waxen quest
#

Okay, but my problem is that i cant edit the followUp reply

tribal thicket
#

Why?

waxen quest
#
        const attemptEmbedReply = await interaction.followUp({ embeds: [attemptEmbed[countPage]], components: [buttonsPage], ephemeral: true })
        const attemptEmbedReplyFetch = await interaction.fetchReply(attemptEmbedReply.id)
        console.log(attemptEmbedReplyFetch)
        const filter = (i) => !i.user.bot
        const attemptEmbedReplyCollector = attemptEmbedReply.createMessageComponentCollector({ filter })

        attemptEmbedReplyCollector.on("collect", async (buttonPressedInteraction) => {

          const ACTION_PRESSED = {
            left: async function (countPage) {
              if (countPage - 2 < 0) {
                buttonsPage.components[0].setDisabled(true)
              }
              buttonsPage.components[1].setDisabled(false)
              return countPage - 1
            },

            right: async function (countPage) {
              if (countPage + 2 >= attemptEmbed.length) {
                buttonsPage.components[1].setDisabled(true)
              }
              buttonsPage.components[0].setDisabled(false)
              return countPage + 1
            },
          }

          countPage = await ACTION_PRESSED[buttonPressedInteraction.customId](countPage)

          await attemptEmbedReplyFetch.editReply({ embeds: [attemptEmbed[countPage]], components: [buttonsPage] })

          await buttonPressedInteraction.deferUpdate()

        })
waxen quest
#

But when I try to edit with editReply or edit isnt work

tribal thicket
#

And how does it "not work"?

waxen quest
#

TypeError: attemptEmbedReplyFetch.editReply is not a function

#

And i dont know how can i do it

tribal thicket
#

it's just interaction.editReply({ message, ...options })

waxen quest
tribal thicket
#

whatever the reply should be edited with

#

The docs tell you this

waxen quest
#

For example this no? await interaction.editReply({ embeds: [attemptEmbed[countPage]], components: [buttonsPage] })