Files
discord.js/src/client/actions/ActionsManager.js
2016-05-01 14:51:46 +01:00

25 lines
512 B
JavaScript

'use strict';
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');
}
register(name) {
let Action = requireAction(name);
this[name] = new Action(this.client);
}
}
module.exports = ActionsManager;