int = message.content discord.js code example

Example 1: args slice discord.js

const args = message.content.slice(prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase(); 

if (command === "RandomCommand") {
  let firstArgs = args[0]; //first argument
  let secondArgs = args[1]; //second argument
  if (firstArgs && secondArgs) { //check if the args are existing
  	message.channel.send(firstArgs, secondArgs) //send the value of the args
  }
}

Example 2: discord bot how to make that only one person can do a command

else if(user == 'USER ID'){
            return message.channel.send('I rate SpaceTie a 100/100')
        }

Tags:

Misc Example