mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
29 lines
744 B
JavaScript
29 lines
744 B
JavaScript
const requireAction = name => require(`./${name}`);
|
|
|
|
class ActionsManager {
|
|
constructor(client) {
|
|
this.client = client;
|
|
|
|
this.register('MessageCreate');
|
|
this.register('MessageDelete');
|
|
this.register('MessageUpdate');
|
|
this.register('ChannelCreate');
|
|
this.register('ChannelDelete');
|
|
this.register('ChannelUpdate');
|
|
this.register('GuildDelete');
|
|
this.register('GuildUpdate');
|
|
this.register('GuildMemberRemove');
|
|
this.register('GuildRoleCreate');
|
|
this.register('GuildRoleDelete');
|
|
this.register('GuildRoleUpdate');
|
|
this.register('UserUpdate');
|
|
}
|
|
|
|
register(name) {
|
|
const Action = requireAction(name);
|
|
this[name] = new Action(this.client);
|
|
}
|
|
}
|
|
|
|
module.exports = ActionsManager;
|