Error with swich case

I have this ticket system but the problem is when i click the "close-button" the message "Cerrando ticket, espere un momento por favor" send but the bot dont change the category of the channel
No description
No description
No description
No description
No description
27 Replies
d.js toolkit
d.js toolkit8mo 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
ShompiFlen
ShompiFlen8mo ago
console.log(ticketType) and show the output of the console here please
01_ixfox
01_ixfoxOP8mo ago
No description
Lilly
Lilly8mo ago
in your code , the console log goes in the code
01_ixfox
01_ixfoxOP8mo ago
who part? in the index?
Lilly
Lilly8mo ago
right above the switch case would be a nice place to put it
01_ixfox
01_ixfoxOP8mo ago
nothing happends, i only got these
01_ixfox
01_ixfoxOP8mo ago
No description
01_ixfox
01_ixfoxOP8mo ago
No description
ShompiFlen
ShompiFlen8mo ago
where did you put the console.log
01_ixfox
01_ixfoxOP8mo ago
No description
ShompiFlen
ShompiFlen8mo ago
okay did the message "cerrando ticket, por favor espere" even show up? was it sent into the channel?
01_ixfox
01_ixfoxOP8mo ago
yes yes
ShompiFlen
ShompiFlen8mo ago
just place the console.log right below where you destructure ticketType
01_ixfox
01_ixfoxOP8mo ago
ready and happends the same thing oh no nvm i got this
01_ixfox
01_ixfoxOP8mo ago
No description
No description
01_ixfox
01_ixfoxOP8mo ago
@ShompiFlen
ShompiFlen
ShompiFlen8mo ago
yea that is what comp was hinting ticketType doesn't exist on an interaction object nor on a discord.js Interaction you can't just destructure it from it
01_ixfox
01_ixfoxOP8mo ago
but i have these const ticketType = interaction.values[0];
ShompiFlen
ShompiFlen8mo ago
one thing is not related to the other
01_ixfox
01_ixfoxOP8mo ago
and why the tycketType works here
01_ixfox
01_ixfoxOP8mo ago
No description
01_ixfox
01_ixfoxOP8mo ago
@ShompiFlen
ShompiFlen
ShompiFlen8mo ago
how did you define ticket type there
01_ixfox
01_ixfoxOP8mo ago
With the id of the tickets
ShompiFlen
ShompiFlen8mo ago
when we ask these questions of "how did you define" "where is this defined" we ask to see your code thats the source of truth
Want results from more Discord servers?
Add your server