uLicense/uLicense-1.2.6/discord/events/message.js
2022-09-15 03:43:05 +01:00

19 lines
560 B
JavaScript

module.exports = (client, msg) => {
if (msg.guild === null) return;
if (msg.guild.id != client.config.serverID) return;
if (msg.author.bot) return;
if (msg.content.indexOf(client.config.prefix) !== 0) return;
const args = msg.content
.slice(client.config.prefix.length)
.trim()
.split(/ +/g);
const command = client.commands.get(args.shift().toLowerCase());
if (!command) return;
console.log(
`\u001b[36m=> [${new Date().toLocaleTimeString()}] ${
msg.author.username
} used ${msg.content} command!`
);
command.run(client, msg, args);
};