1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-23 06:43:17 +00:00

shard logs

This commit is contained in:
MatteZ02 2020-06-23 21:05:44 +03:00
parent 65caded23d
commit 6386a672c5
2 changed files with 7 additions and 5 deletions

View File

@ -18,16 +18,17 @@ module.exports = function (client) {
}).on('rateLimit', (rateLimitInfo) => { }).on('rateLimit', (rateLimitInfo) => {
}).on('shardDisconnect', (event, id) => { }).on('shardDisconnect', (event, id) => {
console.log(`Shard ${id} disconnected event ${event}`); client.logs.push(`Shard ${id} disconnected event ${event}`);
}).on('shardError', (error, shardId) => { }).on('shardError', (error, shardId) => {
console.log(`Shard ${shardId} error ${error}`); client.logs.push(`Shard ${shardId} error ${error}`);
}).on('shardReady', (id, unavailableGuilds) => { }).on('shardReady', (id, unavailableGuilds) => {
console.log(`Shard ${id} ready. Unavailable guilds: ${unavailableGuilds || 0}`); client.logs.push(`Shard ${id} ready. Unavailable guilds: ${unavailableGuilds || 0}`);
}).on('shardReconnecting', (id) => { }).on('shardReconnecting', (id) => {
console.log(`shard ${id} reconnecting.`); client.logs.push(`shard ${id} reconnecting.`);
}).on('shardResume', (id, replayedEvents) => { }).on('shardResume', (id, replayedEvents) => {
console.log(`shard ${id} resume events ${replayedEvents}`); client.logs.push(`shard ${id} resume events ${replayedEvents}`);
}).on("warn", (info) => { }).on("warn", (info) => {
client.logs.push(`Warn! info: ${info}`);
console.log(`Warn! info: ${info}`); console.log(`Warn! info: ${info}`);
}); });
} }

View File

@ -43,6 +43,7 @@ module.exports = class extends Client {
guilds: {}, guilds: {},
}, },
}; };
this.logs = [];
fs.readdirSync(path.join(__dirname, "funcs")).forEach((filename) => { fs.readdirSync(path.join(__dirname, "funcs")).forEach((filename) => {
this.funcs[filename.slice(0, -3)] = require(`./funcs/${filename}`); this.funcs[filename.slice(0, -3)] = require(`./funcs/${filename}`);