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?
18 Replies
d.js toolkit
d.js toolkit9mo 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! - Marked as resolved by OP
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
GustyCube
GustyCubeOP9mo ago
the event isnt triggering like its not logging that
d.js docs
d.js docs9mo ago
If you aren't getting any errors, try to place console.log checkpoints throughout your code to find out where execution stops. - Once you do, log relevant values and if-conditions - More sophisticated debugging methods are breakpoints and runtime inspections: learn more
GustyCube
GustyCubeOP9mo ago
i just did that it doesnt work xd like
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
GustyCube
GustyCubeOP9mo ago
i put in console logs
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
GustyCube
GustyCubeOP9mo ago
there nowhere else to put in logs that would be relevant to this xd
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
GustyCube
GustyCubeOP9mo ago
where do you suggest i place it
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
GustyCube
GustyCubeOP9mo ago
🤨 alright
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
GustyCube
GustyCubeOP9mo ago
maybe im doing something wrong but its definetly still logging
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
GustyCube
GustyCubeOP9mo ago
oh yeah that worked tysm
Want results from more Discord servers?
Add your server