This repository has been archived on 2024-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
discord.js-rr-bot/Src/Structures/Handlers/MessageCommands.js
2022-06-18 23:28:38 -04:00

13 lines
No EOL
644 B
JavaScript

const fs = require("fs");
const Filer = require("../../Utils/Filer");
module.exports = async function(client, path) {
Filer(`${path}/Src/Commands/MessageCommands`, async function(err, res) {
res.forEach(file => {
if (fs.statSync(file).isDirectory()) return;
const command = require(file)
if (command.ignoreFile) return;
client.commands.messageCommands.set(command.name.toLowerCase(), command)
if (command.aliases) command.aliases.forEach(alias => client.commands.messageCommands.aliases.set(alias.toLowerCase(), command.name.toLowerCase()))
})
})
}