mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
23 lines
457 B
JavaScript
23 lines
457 B
JavaScript
'use strict';
|
|
|
|
const fs = require('node:fs');
|
|
|
|
class ActionsManager {
|
|
constructor(client) {
|
|
this.client = client;
|
|
|
|
const files = fs.readdirSync(__dirname);
|
|
|
|
for (const file of files) {
|
|
if (['Action.js', 'ActionsManager.js'].includes(file)) continue;
|
|
this.register(require(`./${file}`));
|
|
}
|
|
}
|
|
|
|
register(Action) {
|
|
this[Action.name.replace(/Action$/, '')] = new Action(this.client);
|
|
}
|
|
}
|
|
|
|
module.exports = ActionsManager;
|