Delete Channel With Button
I have this simple function https://pastebin.com/LygHwdrQ which is meant to do the following:
1: You press the button
2: It deletes the ticket
3: Send a message in dms
but when I click the button it does nothing and the bot doesn't give error.
Pastebin
Delete Channel Ticket - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
52 Replies
- 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.
- Issue solved? Press the button!
There is no error in the console and the function for the button is inside the pastebin link.
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
Which event? The button clicked?
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
yeah first line of pastebin link
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
how can I know if it emits? I am not sure how
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
isnide the if statement of the button or outside?
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
okay testing right now
the button doesn't emits at all
I click the button and it didn't console log
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
sure
Pastebin
// Require the packages/filesconst config = require('dotenv').confi...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
all the other buttons work, the function for the closeButton which delete the ticket it doesn't
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
no not at all
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
that's why I am here, because it didn't make sense
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
it is, I noticed a missing ; so I saved again and restarted the bot to see if that was the problem
also I will create a handler for all the interaction about the ticket when everything works
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
I will, I will move the ping above it to test
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
I have an idea
what if I put the button function with the ping button intraction
while I know the interaction of the ping works
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
^
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
well thats weird
this worked
the interaction was somehow broken xD but the exactly same interaction in the ping was working
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
I FOUND THE PROBLEM
it was simple but dumb problem
there was a missing s
its Events, not Event
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
it didn't
now it works
it was the s
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
thx for the help, btw do you know how can I edit the button of the embed? if you see the code in pastebin there is a Ping Button function below the delete function we where trying to fix, I need somehow to make the ping button available only for one press
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
to be disabled after they press it
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
what is easier?
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
okay thank you!
one more simple question
is there a doc of how to connect handlers to the index.js so the handlers can actually work?
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
I want to create a folder named handlers with all the handlers of the commands buttons inside
I have only events folder which are connecting to index but I followed the docs to do it
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
the slash commands are inside their files with everything they need to do, the buttons can't they have their own handler file than being in the index?
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
okay thx
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
Okay already did it
I managed to do it with some weird magic
Thanks for your help
I will close this now