Create message.js

This commit is contained in:
Hirzi
2021-06-29 12:41:52 +07:00
committed by GitHub
parent 6310e5aef3
commit c4dfa348a0

13
events/message.js Normal file
View File

@@ -0,0 +1,13 @@
module.exports = (client, message) => {
if (message.author.bot) return;
if (message.content.indexOf("-") !== 0) return;
const args = message.content.slice(1).trim().split(/ +/g);
const command = args.shift().toLowerCase();
const cmd = client.commands.get(command);
if (!cmd) return;
cmd.run(client, message, args);
};