If = message is not defined?

hello my name is Esteban, and I have a bug that I have not been able to solve.

In the beginning it appears this if (message.content.startsWith(prefix + “verify me”)) { and when I had already activated the console I get this message not defined and it appears that the error is if you help me to fix it. it will be very helpful because I’m a newbie :slight_smile:

if (message.content.startsWith(prefix + “verificarme”)) {

  const bot = client.emojis.find(emoji => emoji.name === "NLoliDancenk");

  const bot2 = client.emojis.find(emoji => emoji.name === "NLoliEat"); 

  if (message.channel.id !== "814616939116494898") return; 



    message.channel.send(bot2+" Estoy revisando tus datos, aguarde un momento...")

    .then(async m => {

      setTimeout(() => {

        m.edit("" + bot + ""+bot+" ¡Verificando que no eres un robot! " +bot2+""+bot2+"" );

      }, 5000);



      setTimeout(() => {

        m.edit(""+bot+ " Verificando que no seas una multicuenta...");

          }, 8000);

      setTimeout(() => { // Ediciones para darle un toque mas bonito

        const embed = new Discord.RichEmbed()

          .setColor("GREEN")

          .setDescription("¡" +message.author.username + " Felicitaciones, has sido verificado correctamente!");

        m.edit(embed);

      }, 12000); 



      setTimeout(() => {

        message.member.addRole("Rol a agregar");

        message.member.removeRole("ID-ROL-AREMOVER")

     }, 14000);

     m.delete(20000);

});

   message.delete();

 }

Hello and welcome, Esteban!

Please can you paste the error or a screenshot of it, so that we can see which line of code has the problem, and which object is undefined? :slight_smile:

1 Like

Hello Thanks for your answer, I’ve already fixed the problem, it was a simple mistake and I’m late all night looking for it, I’m just missing a number, thank you i’m sorry. :grinning:

1 Like