mirror of
https://github.com/musix-org/musix-oss
synced 2024-11-10 05:10:17 +00:00
20 lines
552 B
JavaScript
20 lines
552 B
JavaScript
const config = require("./config/config.ts");
|
|
|
|
if (config.devMode) {
|
|
console.log('- dev mode- ');
|
|
config.token = config.devToken;
|
|
config.shards = 1;
|
|
}
|
|
|
|
const {
|
|
ShardingManager
|
|
} = require('discord.js');
|
|
const manager = new ShardingManager('./src/bot.ts', {
|
|
token: config.token,
|
|
respawn: config.respawn,
|
|
totalShards: config.shards
|
|
});
|
|
|
|
console.log('- Launching shards -');
|
|
manager.spawn(config.shards, config.shardDelay, config.shardTimeout);
|
|
manager.on('shardCreate', shard => console.log(`- Launched shard ${shard.id} -`)); |