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
d.js toolkit
d.js toolkit2y ago
- 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!
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
node -v
v20.3.1
node -v
v20.3.1
npm list discord.js
npm list discord.js
There is no error in the console and the function for the button is inside the pastebin link.
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
Which event? The button clicked?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
yeah first line of pastebin link
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
how can I know if it emits? I am not sure how
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
isnide the if statement of the button or outside?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
okay testing right now the button doesn't emits at all I click the button and it didn't console log
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
sure
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
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.
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
all the other buttons work, the function for the closeButton which delete the ticket it doesn't
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
no not at all
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
that's why I am here, because it didn't make sense
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
I will, I will move the ping above it to test
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
^
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
well thats weird this worked the interaction was somehow broken xD but the exactly same interaction in the ping was working
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
I FOUND THE PROBLEM it was simple but dumb problem
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
there was a missing s its Events, not Event
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
it didn't now it works it was the s
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
to be disabled after they press it
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
what is easier?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
okay thx
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Dãrķ Søŭł
Dãrķ SøŭłOP2y ago
Okay already did it I managed to do it with some weird magic Thanks for your help I will close this now
Want results from more Discord servers?
Add your server