UNPKG

free-code

Version:

Makes free code for discord.js command/bots

16 lines (15 loc) 583 B
const client = require('../../src/index') const prefix = client.prefix; client.on('message', async message =>{ if(message.author.bot) return; if(!message.content.startsWith(prefix)) return; if(!message.guild) return; const args = message.content.slice(prefix.length).trim().split(/ +/g); const cmd = args.shift().toLowerCase(); if(cmd.length == 0 ) return; let command = client.commands.get(cmd) if(!command) command = client.commands.get(client.aliases.get(cmd)); if(command) { command.run(client, message, args) } });