1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 09:53:17 +00:00
musix-oss/events/events.js
2020-03-19 16:45:05 +02:00

19 lines
743 B
JavaScript

module.exports = function (client) {
const Discord = require('discord.js');
const events = './clientEvents/';
client.on('ready', () => {
require(`${events}ready`).execute(client, Discord);
});
client.on('message', (msg) => {
require(`${events}msg`).execute(client, msg, Discord);
});
client.on('guildCreate', (guild) => {
require(`${events}guildCreate`).execute(client, guild);
});
client.on('voiceStateUpdate', (oldState, newState) => {
require(`${events}voiceStateUpdate`).execute(client, oldState, newState);
});
client.on('error', (error) => {
client.channels.fetch(client.config.debug_channel).send(`Error: ${error} on shard: ${client.shard}`);
});
}