Compare commits

..

No commits in common. "0842652a0901976928bc17b8a254fcc8646bfdd9" and "72a0d10c194e0308510aa812eda2944d94ed6ad0" have entirely different histories.

3 changed files with 7 additions and 7 deletions

View file

@ -19,8 +19,8 @@ module.exports = async function (message, args) {
if (isNaN(timeInSeconds)) { if (isNaN(timeInSeconds)) {
return "Please specify a time, and a message to send after the timer has finished" return "Please specify a time, and a message to send after the timer has finished"
} }
const customMessage = args.slice(1).join(" ") let customMessage = args.slice(1).join(" ")
const reminderTime = currentUnixTime + timeInSeconds let reminderTime = currentUnixTime + timeInSeconds
let newTimerID; let newTimerID;
const db = new sqlite3.Database(databasePath) const db = new sqlite3.Database(databasePath)
let sendText = await new Promise((resolve, reject)=>{ let sendText = await new Promise((resolve, reject)=>{

View file

@ -1,7 +1,7 @@
module.exports = function(time, currentUnixTime){ module.exports = function(time, currentUnixTime){
let timeInSeconds = parseFloat(time) let timeInSeconds = parseFloat(time)
const letterCount = time.length - timeInSeconds.toString().length; const letterCount = time.length - timeInSeconds.toString().length;
const letter = time.slice(time.length - letterCount); let letter = time.slice(time.length - letterCount);
switch (letter.toUpperCase()) { switch (letter.toUpperCase()) {
case "H": case "H":
timeInSeconds = timeInSeconds * 3_600; timeInSeconds = timeInSeconds * 3_600;

View file

@ -1,8 +1,8 @@
module.exports = function(targetTime) { module.exports = function(targetTime) {
const countDownDate = new Date(targetTime).getTime(); let countDownDate = new Date(targetTime).getTime();
const now = new Date().getTime(); let now = new Date().getTime();
const distance = countDownDate - now; let distance = countDownDate - now;
let days = Math.floor(distance / (1000 * 60 * 60 * 24)); let days = Math.floor(distance / (1000 * 60 * 60 * 24));
let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); let hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
@ -16,5 +16,5 @@ module.exports = function(targetTime) {
} }
const totalInSeconds = (days * 24 * 60 * 60) + (hours * 60 * 60) + (minutes * 60) + seconds; const totalInSeconds = (days * 24 * 60 * 60) + (hours * 60 * 60) + (minutes * 60) + seconds;
return { days, hours, minutes, seconds, totalInSeconds }; return { days: days, hours: hours, minutes: minutes, seconds: seconds, totalInSeconds: totalInSeconds };
} }