1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-09-20 04:31:56 +00:00
musix-oss/index.js

13 lines
509 B
JavaScript
Raw Normal View History

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