Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

445
Vistas
Discord.js ReferenceError: channel is not defined while trying to test an embed

I am working on a discord bot and I was trying to test an embed and an error popped up saying

ReferenceError: channel is not defined

This is the code for the embed

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 Respuestas
Responde la pregunta

0

Like the error says you have not defined channel if you want to send the embed to the same channel as your command was used in just do:

message.channel.send(exampleEmbed);

If you are using v13 use:

message.channel.send({embeds: [exampleEmbed]});
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda