2020-03-24 10:02:07 +00:00
|
|
|
const config = require("./src/struct/config/config.ts");
|
2020-03-13 20:31:04 +00:00
|
|
|
|
|
|
|
if (config.devMode) {
|
2020-04-05 21:20:34 +00:00
|
|
|
console.log('- dev mode- ');
|
2020-03-13 20:31:04 +00:00
|
|
|
config.token = config.devToken;
|
|
|
|
config.shards = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
const { ShardingManager } = require('discord.js');
|
2020-03-24 10:02:07 +00:00
|
|
|
const manager = new ShardingManager('./src/bot.ts', { token: config.token, respawn: config.respawn, totalShards: config.shards });
|
2020-03-13 20:31:04 +00:00
|
|
|
|
2020-04-05 21:20:34 +00:00
|
|
|
console.log('- Launching shards -');
|
2020-03-13 20:31:04 +00:00
|
|
|
manager.spawn(config.shards, config.shardDelay, config.shardTimeout);
|
2020-04-05 21:20:34 +00:00
|
|
|
manager.on('shardCreate', shard => console.log(`- Launched shard ${shard.id} -`));
|