📜  args slice discord.js - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:43.250000             🧑  作者: Mango

代码示例1
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
  }
}