1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 13:03:18 +00:00
musix-oss/events/events.js

19 lines
743 B
JavaScript
Raw Normal View History

2020-03-19 14:45:05 +00:00
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}`);
});
}