#Error with swich case

38 messages · Page 1 of 1 (latest)

hard rampart
#

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

vague thicketBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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
young pilot
#

console.log(ticketType) and show the output of the console here please

gloomy pine
hard rampart
gloomy pine
#

right above the switch case would be a nice place to put it

hard rampart
#

nothing happends, i only got these

young pilot
#

where did you put the console.log

hard rampart
young pilot
#

okay did the message "cerrando ticket, por favor espere" even show up?

#

was it sent into the channel?

hard rampart
young pilot
#

just place the console.log right below where you destructure ticketType

hard rampart
#

ready

#

and happends the same thing

#

oh no

#

nvm

#

i got this

#

@young pilot

young pilot
#

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

hard rampart
#

const ticketType = interaction.values[0];

young pilot
#

one thing is not related to the other

hard rampart
#

and why the tycketType works here

#

@young pilot

young pilot
#

how did you define ticket type there

hard rampart
#

With the id of the tickets

young pilot
#

when we ask these questions of "how did you define" "where is this defined" we ask to see your code