mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 22:27:44 +02:00
Restart the Bot every 4 hours
This commit is contained in:
@@ -99,8 +99,14 @@ client.on('guildDelete', async(guild) => {
|
|||||||
|
|
||||||
client.on('disconnect', (event) => {
|
client.on('disconnect', (event) => {
|
||||||
console.log(`[Disconnect] The Shard ${client.shard.id} disconnected with Code ${event.code}.`);
|
console.log(`[Disconnect] The Shard ${client.shard.id} disconnected with Code ${event.code}.`);
|
||||||
|
process.exit(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
client.setTimeout(() => {
|
||||||
|
console.log(`[Restart] Shard ${client.shard.id} Restarted.`);
|
||||||
|
process.exit(0);
|
||||||
|
}, 14400000);
|
||||||
|
|
||||||
client.on('ready', () => {
|
client.on('ready', () => {
|
||||||
console.log(`[Ready] Shard ${client.shard.id} Logged in!`);
|
console.log(`[Ready] Shard ${client.shard.id} Logged in!`);
|
||||||
client.user.setGame(`;help | Shard ${client.shard.id}`);
|
client.user.setGame(`;help | Shard ${client.shard.id}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user