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

444
Views
Discord.js ReferenceError: el canal no está definido al intentar probar una inserción

Estoy trabajando en un bot de Discord y estaba tratando de probar una inserción y apareció un error que decía

ReferenceError: el canal no está definido

Este es el código para la inserción.

 client.on('message', (message) => { console.log(`[${message.author.tag}]: ${message.content}`); if (message.content === 'brh!testembed') { const exampleEmbed = new Discord.MessageEmbed() .setColor('#0099ff') .setTitle('Some title') .setURL('https://discord.js.org/') .setAuthor('Some name', 'https://i.imgur.com/wSTFkRM.png', 'https://discord.js.org') .setDescription('Some description here') .setThumbnail('https://i.imgur.com/wSTFkRM.png') .addFields( { name: 'Regular field title', value: 'Some value here' }, { name: '\u200B', value: '\u200B' }, { name: 'Inline field title', value: 'Some value here', inline: true }, { name: 'Inline field title', value: 'Some value here', inline: true }, ) .addField('Inline field title', 'Some value here', true) .setImage('https://i.imgur.com/wSTFkRM.png') .setTimestamp() .setFooter('Some footer text here', 'https://i.imgur.com/wSTFkRM.png'); channel.send(exampleEmbed); } });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Como el error dice que no ha definido channel si desea enviar la inserción al mismo canal en el que se usó su comando, simplemente haga:

 message.channel.send(exampleEmbed);

Si está utilizando v13 , use:

 message.channel.send({embeds: [exampleEmbed]});
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!