#Persistent Buttons and Dropdowns
12 messages · Page 1 of 1 (latest)
• 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.
Use the interactionCreate event
(event) Client#interactionCreate
Emitted when an interaction is created.
client.on(Events.InteractionCreate, interaction => {
if (!interaction.isButton()) return;
console.log(interaction);
});
Would I use this?
something like this
client.on(Events.InteractionCreate, interaction => {
if(interaction.isChatInputCommand()) {
// command handler
}
if(interaction.isButton()) {
if(interaction.customId === 'id') {
// do something when the button is clicked
}
}
})
Yea
Is it possible to have multiple interactionCreate files in my events folder? Or is that not good practice
it's possible, but it doesn't have sense and uses more resources
Okay, thank you all for the help!