Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

334
Views
TypeError no detectado TypeError: *** no es una función js v13

Mi objetivo es hacer un sistema de selección de menú que abra boletos. Sin embargo, cuando abre un ticket, los roles que deberían tener acceso a los tickets (administrador y moderador) no están accesibles. ¿Usted me podría ayudar?

Aquí está el código:

 Client.on("interactionCreate", interaction => { if(interaction.isSelectMenu()){ if(interaction.customId === "select") { console.log(interaction.values); if(interaction.values == "qst"){ interaction.reply({content: "Vous avez choisi l'option ❓ | Question", ephemeral: true}); nbTicket++; //Nom du ticket interaction.guild.channels.create("ticket-" + nbTicket, { parent: "978962595971211324", //Permissions permissionOverwrites: [ { id: interaction.guild.id, deny: [Discord.Permissions.FLAGS.VIEW_CHANNEL] }, { id: interaction.user.id, allow: [Discord.Permissions.FLAGS.VIEW_CHANNEL] }, { id : interaction.guild.roles.cache("978963146364563456"), allow: [Discord.Permissions.FLAGS.VIEW_CHANNEL] } ] }).then(channel => { var button = new Discord.MessageActionRow() .addComponents(new Discord.MessageButton() .setCustomId("close-ticket") .setLabel("Fermet le ticket") .setStyle("DANGER") ); //Message du bot à l'open du ticket channel.send({content: "<@" + interaction.user.id + "> a ouvert un ticket de la catégorie ❓ | Question", components: [button]}); //Remise à 0 interaction.update("Sélectionnez une option pour ouvrir un ticket"); }); }

Este es el error que me sale:

 Uncaught TypeError TypeError: interaction.guild.roles.cache is not a function

Gracias y que tenga un buen día !

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

RoleManager.cache no es una función, es un captador que devuelve Collection<Snowflake, Role> .

Probablemente lo que estás buscando es

 interaction.guild.roles.cache.get("978963146364563456")

en vez de

 interaction.guild.roles.cache("978963146364563456")

Ver Colección.get

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!