cleaned up var names
This commit is contained in:
parent
d1a4b2cf5c
commit
9e47046c7b
1 changed files with 7 additions and 14 deletions
|
@ -13,52 +13,45 @@ class EventHandler {
|
|||
break;
|
||||
}
|
||||
|
||||
// param_1 - error message
|
||||
case 'error': {
|
||||
const errorModules = this.client.eventModules.filter(module => module.wsEvent === 'error');
|
||||
errorModules.forEach(module => module.run(this.client, param_1));
|
||||
errorModules.forEach(module => module.run(this.client, error));
|
||||
break;
|
||||
}
|
||||
|
||||
// param_1 - message object
|
||||
case 'messageCreate': {
|
||||
const mCreateModules = this.client.eventModules.filter(module => module.wsEvent === 'messageCreate');
|
||||
mCreateModules.forEach(module => module.run(this.client, param_1));
|
||||
mCreateModules.forEach(module => module.run(this.client, message));
|
||||
break;
|
||||
}
|
||||
|
||||
// param_1 - guild object
|
||||
case 'guildCreate': {
|
||||
const gCreateModules = this.client.eventModules.filter(module => module.wsEvent === 'guildCreate');
|
||||
gCreateModules.forEach(module => module.run(this.client, param_1));
|
||||
gCreateModules.forEach(module => module.run(this.client, guild));
|
||||
break;
|
||||
}
|
||||
|
||||
// param_1 - guild object
|
||||
case 'guildDelete': {
|
||||
const gDeleteModules = this.client.eventModules.filter(module => module.wsEvent === 'guildDelete');
|
||||
gDeleteModules.forEach(module => module.run(this.client, param_1));
|
||||
gDeleteModules.forEach(module => module.run(this.client, guild));
|
||||
break;
|
||||
}
|
||||
|
||||
// param_1 - guild object | param_2 - member object
|
||||
case 'guildMemberAdd': {
|
||||
const gMemberAddModules = this.client.eventModules.filter(module => module.wsEvent === 'guildMemberAdd');
|
||||
gMemberAddModules.forEach(module => module.run(this.client, param_1, param_2));
|
||||
gMemberAddModules.forEach(module => module.run(this.client, guild, member));
|
||||
break;
|
||||
}
|
||||
|
||||
// param_1 - guild object | param_2 - member object
|
||||
case 'guildMemberRemove': {
|
||||
const gMemberRemoveModules = this.client.eventModules.filter(module => module.wsEvent === 'guildMemberRemove');
|
||||
gMemberRemoveModules.forEach(module => module.run(this.client, param_1, param_2));
|
||||
gMemberRemoveModules.forEach(module => module.run(this.client, guild, member));
|
||||
break;
|
||||
}
|
||||
|
||||
// param_1 - old voice state | param_2 - new voice state
|
||||
case 'voiceStateUpdate': {
|
||||
const vStateUpdateModules = this.client.eventModules.filter(module => module.wsEvent === 'voiceStateUpdate');
|
||||
vStateUpdateModules.forEach(module => module.run(this.client));
|
||||
vStateUpdateModules.forEach(module => module.run(this.client, oVoiceState, nVoiceState));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue