Is it possible to get the custom ID from interactionCreate for buttons?
client.on("interactionCreate", interaction => {
if (interaction.isButton()) {
// I want to get the CustomId of the button that was pressed here.
}
})
It can be changed to this and it can be obtained
client.on("interactionCreate", interaction => {
if (interaction.isButton()) {
const btn_id = interaction.customId;
//btn_id = your button id
}
})
By using .customId
client.on("interactionCreate", interaction => {
if (interaction.isButton()) {
// interaction.customId;
}
})