/wouldyourather (slash command, issue with buttons)
Can anyone look at my code to see why buttons are not working I am trying to make code for /wouldyourrather slash command which prompts the user to enter input1 and input2 by pressing the option buttons then pressing enter to simulate voting and then ends the poll but the buttons are not working for some reason. I would appreciate it if you can look at my code and let me know if you can pinpoint the issue, here is the current code:
https://sourceb.in/u0vgGQU2ZK
13 Replies
- 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!mines is most likely discord.js version 14
here is the raw code
version here
raw code is here
explanation of what I need help with is here
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@Squid where should I put console.log checkpoints and how to should I implement this
you saying that your buttons are "not working" is way too vague
are the buttons getting sent? is the collector collecting the button interactions? does your vote map contain the scenario? are the new options being pushed to the vote map? is the collector's
end
event properly emitting, and if so, how far in it does your code run?
Find out exactly where your code stops working by seeing when a basic console log doesnt appearto be honest with you i don't know js at all i used ai to code this lol
it Says interaction failed on the discord server and then "Invalid button interaction: missing data" in the terminal im hosting it
but I want it to work
ok ill go tell the ai how to fix things
you will?
if you don't know how to code, i wont be able to explain things in a way youd understand
you're expected to come into djs with a basic JS proficiency re #rules
okay i was using gemini google ai btw and its somewhat understandable
i have basic coding knowledge just not js
i can understand the code thoughh
if i look through it kind of
the AI is making up properties that dont actually exist
you should use the official documentation and guide to see what does exist, and base your logic around that
Send the official documentation
I’ll take a look
Its at the top of #resources