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

35 lines
952 B
JavaScript
Raw Normal View History

2020-04-20 16:56:23 +00:00
const config = require("./config/config.js");
/*const admin = require("firebase-admin");
const serviceAccount = require("./config/serviceAccount.json");
const secondaryAppConfig = {
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://global-1f5f9.firebaseio.com",
};
const secondary = admin.initializeApp(secondaryAppConfig, "secondary");
const globaldb = secondary.database();
const global = {
db: {
guilds: {},
},
};*/
2020-03-13 20:31:04 +00:00
if (config.devMode) {
2020-04-20 16:56:23 +00:00
console.log("- dev mode- ");
config.token = config.devToken;
config.shards = 1;
2020-03-13 20:31:04 +00:00
}
2020-04-19 17:00:16 +00:00
const {
2020-04-20 16:56:23 +00:00
ShardingManager
} = require("discord.js");
const manager = new ShardingManager("./src/bot.js", {
token: config.token,
respawn: config.respawn,
totalShards: config.shards,
2020-04-19 17:00:16 +00:00
});
2020-03-13 20:31:04 +00:00
2020-04-20 16:56:23 +00:00
console.log("- Launching shards -");
2020-03-13 20:31:04 +00:00
manager.spawn(config.shards, config.shardDelay, config.shardTimeout);
2020-04-20 16:56:23 +00:00
manager.on("shardCreate", (shard) =>
console.log(`- Launched shard ${shard.id} -`)
);