Add boilerplate

This commit is contained in:
2022-08-26 03:07:35 +00:00
parent 82f724e6ad
commit 5d5c3bfa94
9 changed files with 149 additions and 2 deletions

25
lib/getCommands.js Normal file
View File

@@ -0,0 +1,25 @@
'use strict';
const fs = require('fs');
const path = require('path');
const { Collection } = require('discord.js');
module.exports = () => {
const commands = new Collection();
fs.readdirSync(path.join(__dirname, '..', 'commands'))
.filter(file => file.endsWith('.js'))
.forEach(file => {
const command = require(path.join(
__dirname,
'..',
'commands',
file
));
commands.set(command.data.name, command);
});
return commands;
};