How to create a command that receives attributes in Discord in js code example
Example 1: discord.js command prompt notification
bot.on('ready', () => {
console.log('Logged in as TEMPLATE');
});
Example 2: How to create a command that receives attributes in Discord in js
if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).trim().split(' ');
const command = args.shift().toLowerCase();
Example 3: How to create a command that receives attributes in Discord in js
else if (command === 'args-info') {
if (!args.length) {
return message.channel.send(`You didn't provide any arguments, ${message.author}!`);
}
message.channel.send(`Command name: ${command}\nArguments: ${args}`);
}