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

385
Views
No se pueden leer las propiedades de undefined (leyendo 'canales')

Estoy tratando de hacer un evento de que cuando alguien agregue mi bot, enviará un mensaje incrustado en un canal que mi bot puede enviar el mensaje incrustado.

discordia.js: v13.6.0

Nodo: v17.7.2

eventos/guildCreate.js

 const client = require("../index"); const discord = require("discord.js") client.on("guildCreate", async (client, guild) => { let channel = guild.channels.cache.find( channel => channel.type === "text" && channel.permissionsFor(guild.me).has("SEND_MESSAGES") ); channel.send( new discord.MessageEmbed() .setDescription("**Thank you for adding me!**") .setColor("#fcba03")) })

editar: solucioné un poco mi problema con los canales de lectura:

 const client = require("../index"); const { MessageEmbed } = require("discord.js") client.on("guildCreate", async (guild, message) => { let channel = guild.channels.cache.find( channel => channel.type === "text" && channel.permissionsFor(guild.me).has("SEND_MESSAGES") ); const embed = new MessageEmbed() embed.setDescription("Thank you for adding me!") embed.setColor("#2f3136") message.guild.channels.cache.get(channel).send(embed) })

pero luego nuevamente obtuve un nuevo error: TypeError: no se pueden leer las propiedades de undefined (leyendo 'gremio')

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

0

Creo que su "canal" es una matriz en lugar de un objeto de canal, porque está filtrando todos los canales de texto. Asegúrese de seleccionar el primer canal de la matriz/colección.

Intenta mostrar lo que aparece cuando inicias sesión en el "canal"

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!