Bossk
Bossk
DIAdiscord.js - Imagine an app
Created by Bossk on 8/22/2023 in #djs-questions
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 ❤️
2 replies
DIAdiscord.js - Imagine an app
Created by Bossk on 8/21/2023 in #djs-questions
Use `client` in multiple files?
Hi! I'm pretty new to d.js but have a question regarding whats common practice. I define my client in index.js, but now I need to interact with the client from a different file. What's the best way to do this? I assume I shouldn't/can't define client two times
45 replies