Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- module.exports = (client, message) => {
- const ninjaPrefix = (`<@636257382829129739>`);
- const prefix = process.env.PREFIX;
- if (message.author.bot) return;
- if (message.content.indexOf(prefix) !== 0) return;
- client.message = message;
- let cmdEmbed = new Discord.RichEmbed()
- .setTitle(":no_entry: Command Error :no_entry:")
- .setColor("0xff0000")
- .setTimestamp()
- .setDescription(`<@${message.author.id}> Sorry that command doesn't exist :shrug:`)
- const args = message.content.slice(prefix.length).trim().split(/ +/g);
- //console.log(args);
- const command = args.shift().toLowerCase();
- //console.log(command);
- const cmd = client.commands.get(command);
- //console.log(cmd);
- if (!cmd) return message.channel.send(cmdEmbed);
- //console.log(cmd);
- cmd.run(client, message, args);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement