Compare commits

..

No commits in common. "425e1c32939320b217bbf05cb0ee89d2f4605b9a" and "17e7aa3dbb8521c48aed51df872f890f32254767" have entirely different histories.

3 changed files with 5 additions and 6 deletions

View file

@ -38,7 +38,7 @@ module.exports = {
sendText = "Please specify a time, and a message to send after the timer has finished";
break;
}
if(!isNaN(parseTime(args[0], Math.floor(new Date() / 1000)) || !isNaN(args[0])))
if(!isNaN(parseTime(args[0], Math.floor(new Date() / 1000))))
sendText = await createTimer(message, args);
break;
}

View file

@ -48,7 +48,6 @@ client.whitelist = {
guild: new Collection(),
user: new Collection()
}
process.env.TZ = "UTC";
createAndLoadWhitelistTable(client.whitelist);

View file

@ -4,20 +4,20 @@ const sqlite3 = require('sqlite3').verbose();
module.exports = async function (message, args) {
const databasePath = 'data/database.db'
if (args.length < 2)
return "Please specify a time, and a message to send after the timer has finished";
return message.channel.send("Please specify a time, and a message to send after the timer has finished");
let currentUnixTime = Math.floor(new Date() / 1000);
let timeInSeconds;
if(!isNaN(Date.parse(args[0])) && isNaN(parseTime(args[0], currentUnixTime))){
if(!isNaN(Date.parse(args[0])) && isNaN(parseTime(args[0]))){
timeInSeconds = timeUntil(args[0]).totalInSeconds;
if(timeInSeconds < 0){
return "The date must not be in the past."
return message.channel.send("The date must not be in the past.");
}
}else {
timeInSeconds = parseTime(args[0], currentUnixTime);
}
if (isNaN(timeInSeconds)) {
return "Please specify a time, and a message to send after the timer has finished"
return message.channel.send("Please specify a time, and a message to send after the timer has finished")
}
let customMessage = args.slice(1).join(" ")
let reminderTime = currentUnixTime + timeInSeconds