im new to making discord bots with node.js, i am having trouble with an error, it says that message is not defined in line 14 and 18

here,try this:

client.on('message', message =>{
if(message.content.startsWith(prefix) ||message.author.bot) return;
const args = message.content.slice(prefix.lenght).split(/+/);
const command = args.shift().toLowerCase();
if(command === 'blackhumour'){
    message.channel.send('What is the difference between a kid and a bowling ball? when you put your fingers in one it doesnt scream');
  }  else if(command === 'sex'){
   message.channel.send('no you fucking pervert');
   }
  });

Browse More Popular Posts

Leave a Comment