2021-06-24 09:53:19 +02:00
|
|
|
const { ShardingManager } = require("discord.js");
|
2021-07-13 05:17:39 +02:00
|
|
|
require("dotenv").config();
|
|
|
|
const manager = new ShardingManager(`./bot.js`, {
|
|
|
|
token: process.env.TOKEN,
|
2021-09-06 12:38:25 +02:00
|
|
|
totalShards: "auto",
|
2021-06-24 09:53:19 +02:00
|
|
|
});
|
|
|
|
|
2021-07-13 05:17:39 +02:00
|
|
|
manager.on(`shardCreate`, shard => {
|
2021-06-24 09:53:19 +02:00
|
|
|
console.log(
|
|
|
|
`[${new Date().toString().split(" ", 5).join(" ")}] Spawned shard #${
|
|
|
|
shard.id
|
|
|
|
}`
|
|
|
|
);
|
|
|
|
});
|
2021-09-06 12:38:25 +02:00
|
|
|
manager.spawn({ delay: 5500, timeout: 30000 });
|