Answers for "how is args used discord.js"

1

define args discord

if (!message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).trim().split(' ');
const command = args.shift().toLowerCase();
Posted by: Guest on December-20-2020
1

discord.js arguments

//Seperate Arguments
let seperateArgs = args[0]; //0 being the first argument
//Input "hello world"
//Output "hello"

//Full Arguments
let fullArgs = args.slice(0).join(' ');
//Input "hello world"
//Output "hello world"
Posted by: Guest on January-15-2021

Browse Popular Code Answers by Language