diff --git a/app.js b/app.js index 1a9512e..1de3a05 100644 --- a/app.js +++ b/app.js @@ -29,7 +29,7 @@ function vypocitatCas(vojsl) { let d = new Date(); let hod = d.getHours(); let min = d.getMinutes(); - if (min > 25 && min < 55) { + if (min > 30) { min = 0; if (hod == 23) { hod = 0; @@ -42,16 +42,25 @@ function vypocitatCas(vojsl) { } d.setHours(hod); d.setMinutes(min); + d.setSeconds(0); setTimeout(function() { rekniCas2(vojsl, `${nula(hod)}${nula(min)}`); - }, d - c); + }, d - c + 3000); } function rekniCas2(vojsl, cas) { if (!vojsl) return; const disp = vojsl.play(`./zvuky/${cas}.mp3`); disp.on('finish', () => vojsl.play('./zvuky/grg.mp3')); + + const d1 = vojsl.play(`./zvuky/intro.mp3`); + d1.on('finish', function () { + const d2 = vojsl.play(`./zvuky/${cas}.mp3`); + d2.on('finish', function () { + vojsl.play(`./zvuky/grg.mp3`); + }); + }); vypocitatCas(vojsl); } @@ -75,6 +84,7 @@ client.on('message', mes => { break; case 'rekni': + if (mes.author.bot) return; corict = celArgs ? celArgs : 'co mam jako ric'; mes.channel.send(corict); break; diff --git a/zvuky/intro.mp3 b/zvuky/intro.mp3 new file mode 100644 index 0000000..3e8611b Binary files /dev/null and b/zvuky/intro.mp3 differ