This repository has been archived on 2024-10-31. You can view files and clone it, but cannot push or open issues or pull requests.
Files
ShareX-Upload-Server/bot/events/messageCreate.js
2021-08-18 00:12:37 -07:00

13 lines
506 B
JavaScript

async function messageCreate(msg) {
if (!this.c.discordAdminIDs.includes(msg.author.id)) return;
if (msg.content.indexOf(this.c.prefix) !== 0) return;
const args = msg.content.slice(this.c.prefix.length).trim().split(/ +/g);
const command = args.shift().toString().toLowerCase();
for (let i = 0; this.commands.length > i; i++) {
if (this.commands[i].command === command) {
this.commands[i].execute(this, msg, args);
}
}
}
module.exports = messageCreate;