From 946fbfd0a949a7ce8eff47a36e7a88173c94b112 Mon Sep 17 00:00:00 2001 From: ZyLacx Date: Wed, 10 Feb 2021 01:26:01 +0100 Subject: [PATCH] Update node.js --- node.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/node.js b/node.js index 84cba0d..d5afd64 100644 --- a/node.js +++ b/node.js @@ -20,6 +20,8 @@ var remainingDok; var remainingMartin; var remainingEnd; var left = 0; +var andrewCountdown = new Date("2021, 2, 11, 17:00").getTime(); +var end = false; var ping = 86400; var countdownChannel; var first = true; @@ -28,12 +30,12 @@ var otherChannel; client.once('ready', () => { console.log('Im online!'); + channelsend = client.channels.cache.find(channel => channel.id === "490610642106056707"); countdownChannel = client.channels.cache.find(channel => channel.id === "765243559758397470"); setInterval(countdowns, 1000, 1); }); client.on('message', message => { - const args = message.content.split(' '); //storedMessages.push(message.content); @@ -111,6 +113,16 @@ client.on('message', message => { function countdowns(plus) { left += plus; + andrewCountdown; + let rn = new Date().getTime(); + + if(rn > andrewCountdown && end == false){ + channelsend.send("<@401044257655488514> BITCH, DING DONG BEŽ SI ROBIŤ MOTIVAČNÝ"); + channelsend.send("<@401044257655488514> DING DOOOOONG"); + channelsend.send("<@401044257655488514>"); + channelsend.send("<@401044257655488514>"); + end = true; + } let now = new Date().toDateString; @@ -190,8 +202,8 @@ function sendEmbed(){ remainingSjl = calcTime(sjl - now); remainingMat = calcTime(mat - now); remainingDok = calcTime(dokument - now); - remainingXiao = calcTime(xiao - now); + channelsend.send("<@401044257655488514> BITCH, DING DONG BEŽ SI ROBIŤ MOTIVAČNÝ"); const embed = new Discord.MessageEmbed() .addField("Čas do odovzdania dokumentácie: ", remainingDok) .addField("‎", "‎")