diff --git a/main.js b/main.js index 08cf797..fdba954 100755 --- a/main.js +++ b/main.js @@ -66,10 +66,11 @@ client.once('ready', async () => { debugChannel.send(turnOnMsg[help.RNG(turnOnMsg.length)]); } } + await dbConnect(); cron.schedule('0 13 * * *', async function() { ping(); }); - await dbConnect(); + ping(); console.log('Running!'); }); diff --git a/messageHandler.js b/messageHandler.js index a31aa3d..bdffa6c 100644 --- a/messageHandler.js +++ b/messageHandler.js @@ -34,8 +34,7 @@ function gotMessage(message) { } if (process.env.DEBUG == 'ON') { - const debugger_ = require('./.debug.js'); - debugger_.debug(message); + // smth } } diff --git a/ping.js b/ping.js index 7e72101..8f752de 100644 --- a/ping.js +++ b/ping.js @@ -1,7 +1,7 @@ require('dotenv').config(); const client = require('./main'); const { bModel, eModel } = require('./database/schemas'); -const help = require('./helpFunctions'); +const { getGifEmbed } = require('./gifs'); module.exports = pingEvent; @@ -26,7 +26,7 @@ async function pingEvent() { const userId = todayBirthdays[j].id; if ((await guild.members.fetch()).find(user => user.id == userId) != undefined) { const gifAmount = 12; - const embed = await help.getGifEmbed(`https://g.tenor.com/v1/search?q=anime-hug&key=${process.env.TENOR}&limit=${gifAmount}`, gifAmount); + const embed = await getGifEmbed(`https://g.tenor.com/v1/search?q=anime-hug&key=${process.env.TENOR}&limit=${gifAmount}`, gifAmount); embed.setDescription(`Happy Birthday <@${userId}> !!!`); client.channels.cache.get(sysChannelIds[i]) .send({ embeds: [embed] });