1
0
mirror of https://github.com/musix-org/musix-oss synced 2025-02-23 13:39:44 +00:00
musix-oss/index.js

32 lines
775 B
JavaScript
Raw Normal View History

2024-02-10 09:33:59 +02:00
const { ShardingManager} = require("discord.js");
const config = require("./src/config/config.js");
2020-06-16 21:51:11 +03:00
const DiscordWebhook = require("discord-webhook-node");
2020-03-13 22:31:04 +02:00
if (config.devMode) {
2020-04-20 19:56:23 +03:00
console.log("- dev mode- ");
config.shards = 1;
2020-03-13 22:31:04 +02:00
}
2020-04-20 19:56:23 +03:00
const manager = new ShardingManager("./src/bot.js", {
token: config.token,
respawn: config.respawn,
totalShards: config.shards,
2020-04-19 20:00:16 +03:00
});
2020-03-13 22:31:04 +02:00
2020-04-20 19:56:23 +03:00
console.log("- Launching shards -");
2020-03-13 22:31:04 +02:00
manager.spawn(config.shards, config.shardDelay, config.shardTimeout);
2020-04-20 19:56:23 +03:00
manager.on("shardCreate", (shard) =>
console.log(`- Launched shard ${shard.id} -`)
2020-06-16 21:51:11 +03:00
);
const oldConsole = {};
oldConsole.log = console.log;
console.log = function (arg) {
oldConsole.log(arg);
};
oldConsole.error = console.error;
console.error = function (arg) {
oldConsole.error(arg);
2024-02-10 09:33:59 +02:00
};