22 lines
666 B
JavaScript
22 lines
666 B
JavaScript
const fs = require('fs');
|
|
const { logger } = require('../index');
|
|
|
|
(async () => {
|
|
const files = await fs.promises.readdir('commands');
|
|
files
|
|
.filter(file => file.endsWith('.js'))
|
|
.forEach(file => {
|
|
try {
|
|
const mod = require(`../commands/${file}`);
|
|
this.commands.push(mod);
|
|
} catch(e) {
|
|
logger.error(`Failed to load '${file}':\n${e}`);
|
|
}
|
|
});
|
|
})();
|
|
|
|
/**
|
|
*
|
|
* @type {Array<{ meta: { name: String, aliases: String[], description: String?, devLevel: number? }, run(import(revolt.js).Message, args: String[]): Promise }>}
|
|
*/
|
|
module.exports.commands = []; |