mirror of
https://github.com/musix-org/musix-oss
synced 2025-08-01 20:54:33 +00:00
to js
This commit is contained in:
39
index.js
39
index.js
@@ -1,20 +1,35 @@
|
||||
const config = require("./config/config.ts");
|
||||
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: {},
|
||||
},
|
||||
};*/
|
||||
|
||||
if (config.devMode) {
|
||||
console.log('- dev mode- ');
|
||||
config.token = config.devToken;
|
||||
config.shards = 1;
|
||||
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
|
||||
ShardingManager
|
||||
} = require("discord.js");
|
||||
const manager = new ShardingManager("./src/bot.js", {
|
||||
token: config.token,
|
||||
respawn: config.respawn,
|
||||
totalShards: config.shards,
|
||||
});
|
||||
|
||||
console.log('- Launching shards -');
|
||||
console.log("- Launching shards -");
|
||||
manager.spawn(config.shards, config.shardDelay, config.shardTimeout);
|
||||
manager.on('shardCreate', shard => console.log(`- Launched shard ${shard.id} -`));
|
||||
manager.on("shardCreate", (shard) =>
|
||||
console.log(`- Launched shard ${shard.id} -`)
|
||||
);
|
Reference in New Issue
Block a user