Button Interaction
Hey, heres my code: buttonCollector.on('collect', async buttonInteraction => {
console.log(buttonInteraction.customId);
if (buttonInteraction.customId === 'accept') {
const paymentMethods = allowedUsers[freelancerId];;
const paypalButton = new ButtonBuilder()
.setCustomId('paypal')
.setLabel('PayPal')
.setStyle(ButtonStyle.Primary);
const cashAppButton = new ButtonBuilder()
.setCustomId('cashapp')
.setLabel('CashApp')
.setStyle(ButtonStyle.Primary);
const paymentActionRow = new ActionRowBuilder()
.addComponents(paypalButton, cashAppButton);
const acceptEmbed = new EmbedBuilder()
.setTitle('Payment Options')
.setDescription('Please select a payment method:')
.setColor('Blue');
await buttonInteraction.update({ embeds: [acceptEmbed], components: [paymentActionRow] });
} else if (buttonInteraction.customId === 'decline') {
buttonInteraction.reply({ content: 'Payment request declined.', ephemeral: true });
} else if (buttonInteraction.customId === 'decline') {
buttonInteraction.reply({ content: 'Payment request declined.', ephemeral: true });
}
});. It doesnt seem to be getting here, did I do smth wrong?
console.log(buttonInteraction.customId);
if (buttonInteraction.customId === 'accept') {
const paymentMethods = allowedUsers[freelancerId];;
const paypalButton = new ButtonBuilder()
.setCustomId('paypal')
.setLabel('PayPal')
.setStyle(ButtonStyle.Primary);
const cashAppButton = new ButtonBuilder()
.setCustomId('cashapp')
.setLabel('CashApp')
.setStyle(ButtonStyle.Primary);
const paymentActionRow = new ActionRowBuilder()
.addComponents(paypalButton, cashAppButton);
const acceptEmbed = new EmbedBuilder()
.setTitle('Payment Options')
.setDescription('Please select a payment method:')
.setColor('Blue');
await buttonInteraction.update({ embeds: [acceptEmbed], components: [paymentActionRow] });
} else if (buttonInteraction.customId === 'decline') {
buttonInteraction.reply({ content: 'Payment request declined.', ephemeral: true });
} else if (buttonInteraction.customId === 'decline') {
buttonInteraction.reply({ content: 'Payment request declined.', ephemeral: true });
}
});. It doesnt seem to be getting here, did I do smth wrong?