mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 14:55:40 +02:00
Catch that
This commit is contained in:
@@ -7,7 +7,11 @@ manager.spawn(undefined, 1000);
|
||||
|
||||
setInterval(async () => {
|
||||
if (!manager.shards.has(0)) return;
|
||||
const guilds = await manager.fetchClientValues('guilds.size');
|
||||
const count = guilds.reduce((prev, val) => prev + val, 0);
|
||||
postStats(count, await manager.shards.get(0).fetchClientValue('user.id'));
|
||||
try {
|
||||
const guilds = await manager.fetchClientValues('guilds.size');
|
||||
const count = guilds.reduce((prev, val) => prev + val, 0);
|
||||
await postStats(count, await manager.shards.get(0).fetchClientValue('user.id'));
|
||||
} catch (err) {
|
||||
console.error(`[STATS] Failed to post stats. ${err}`);
|
||||
}
|
||||
}, 300000);
|
||||
|
||||
+1
-1
@@ -106,6 +106,6 @@ client.setInterval(() => {
|
||||
client.login(TOKEN);
|
||||
|
||||
process.on('unhandledRejection', err => {
|
||||
console.error('[FATAL] Unhandled Promise Rejection:', err);
|
||||
console.error('[FATAL] Unhandled Promise Rejection.', err);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user