I have
const fs = require('fs');
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
const command = require(./commands/${file}
);
client.commands.set(command.name, command);
}
cleint.once('ready', () => { console.log('KindnessBot is online!'); cleint.user.setActivity('Use !help for a list of commands, made by Keaton8legs', { type: 'WATCHING' }).catch(console.error); });
cleint.on('message', message =>{ if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'ping'){
client.commands.get('ping').execute(message, args);
and i also have
module.export = {
name: 'ping',
description: "this is a ping command!",
execute(message, args){
message.channel.send('pong!');
}
}