Updating a set of buttons in a reply

I have the following case: 1. I create a message with a button attached and post this in a channel 2. When the button is pressed, it shall send a ephemeral message to the user with a set of new buttons ((everything works until here)) 3. When the user clicks one of the new buttons, the buttons should update. I don't get this working. This is my code:
module.exports = {
name: Events.InteractionCreate,
async execute(interaction) {
if (interaction.customId === 'buynowbtn') {
const response = await interaction.reply({
content: `**Select your desired subscription length**`,
components: [subscriptionsListRow],
ephemeral: true
});
console.log(response.interaction.customId) // This logs 'buynowbtn'. I want it to log the `response`
}
},
};
module.exports = {
name: Events.InteractionCreate,
async execute(interaction) {
if (interaction.customId === 'buynowbtn') {
const response = await interaction.reply({
content: `**Select your desired subscription length**`,
components: [subscriptionsListRow],
ephemeral: true
});
console.log(response.interaction.customId) // This logs 'buynowbtn'. I want it to log the `response`
}
},
};
So I basically want to treat response as a new interaction, but for some reason when I log response.interaction.customId it logs the original button. Very thankful for ANY input on this ❤️
1 Reply
d.js toolkit
d.js toolkit17mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Want results from more Discord servers?
Add your server