Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* DAILY SHOP FORTNITE */
let fortniteShop = require("../utils/fortniteShop.js");
fortniteShop.init(client);
/* AUTO UPDATE DOCS */
let autoUpdateDocs = require("../utils/autoUpdateDocs.js");
autoUpdateDocs.update(client);
// Start the dashboard
if(client.config.dashboard.enabled){
client.dashboard.load(client);
}
// Start update of giveaways
let giveawaysOptions = { updateCountdownEvery: 15000, ignoreIfHasPermission: [ "ADMINISTRATOR" ], storage: require("path").resolve()+"/giveaways.json" };
giveaways.launch(client, giveawaysOptions);
// Update the game every 20s
const status = require("../config.js").status,
version = require("../package.json").version;
let i = 0;
setInterval(function(){
let toDisplay = status[parseInt(i, 10)].name.replace("{serversCount}", client.guilds.size)+" | v"+version;
client.user.setActivity(toDisplay, {type: status[parseInt(i, 10)].type});
if(status[parseInt(i+1, 10)]) i++
else i = 0;
}, 20000); // Every 20 seconds
}
}
setupGiveaways() {
if (!games.includes('GIVEAWAYS')) {
this.logger.debug('No init: giveaways. Feature flag disabled.');
return;
}
giveaways.launch(this.bot.client, {
updateCountdownEvery: 5000,
botsCanWin: false,
ignoreIfHasPermission: [],
embedColor: '#748BD7',
embedColorEnd: '#FF0000',
reaction: '🎉',
storage: `${__dirname}/giveaways.json`,
});
this.logger.info('Giveaways initialized!');
}