Compare commits
4 commits
17e7aa3dbb
...
425e1c3293
Author | SHA1 | Date | |
---|---|---|---|
425e1c3293 | |||
22d1cbd570 | |||
ec5993e585 | |||
0dc6af5984 |
3 changed files with 6 additions and 5 deletions
|
@ -38,7 +38,7 @@ module.exports = {
|
||||||
sendText = "Please specify a time, and a message to send after the timer has finished";
|
sendText = "Please specify a time, and a message to send after the timer has finished";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(!isNaN(parseTime(args[0], Math.floor(new Date() / 1000))))
|
if(!isNaN(parseTime(args[0], Math.floor(new Date() / 1000)) || !isNaN(args[0])))
|
||||||
sendText = await createTimer(message, args);
|
sendText = await createTimer(message, args);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ client.whitelist = {
|
||||||
guild: new Collection(),
|
guild: new Collection(),
|
||||||
user: new Collection()
|
user: new Collection()
|
||||||
}
|
}
|
||||||
|
process.env.TZ = "UTC";
|
||||||
|
|
||||||
createAndLoadWhitelistTable(client.whitelist);
|
createAndLoadWhitelistTable(client.whitelist);
|
||||||
|
|
||||||
|
|
|
@ -4,20 +4,20 @@ const sqlite3 = require('sqlite3').verbose();
|
||||||
module.exports = async function (message, args) {
|
module.exports = async function (message, args) {
|
||||||
const databasePath = 'data/database.db'
|
const databasePath = 'data/database.db'
|
||||||
if (args.length < 2)
|
if (args.length < 2)
|
||||||
return message.channel.send("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";
|
||||||
let currentUnixTime = Math.floor(new Date() / 1000);
|
let currentUnixTime = Math.floor(new Date() / 1000);
|
||||||
|
|
||||||
let timeInSeconds;
|
let timeInSeconds;
|
||||||
if(!isNaN(Date.parse(args[0])) && isNaN(parseTime(args[0]))){
|
if(!isNaN(Date.parse(args[0])) && isNaN(parseTime(args[0], currentUnixTime))){
|
||||||
timeInSeconds = timeUntil(args[0]).totalInSeconds;
|
timeInSeconds = timeUntil(args[0]).totalInSeconds;
|
||||||
if(timeInSeconds < 0){
|
if(timeInSeconds < 0){
|
||||||
return message.channel.send("The date must not be in the past.");
|
return "The date must not be in the past."
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
timeInSeconds = parseTime(args[0], currentUnixTime);
|
timeInSeconds = parseTime(args[0], currentUnixTime);
|
||||||
}
|
}
|
||||||
if (isNaN(timeInSeconds)) {
|
if (isNaN(timeInSeconds)) {
|
||||||
return message.channel.send("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"
|
||||||
}
|
}
|
||||||
let customMessage = args.slice(1).join(" ")
|
let customMessage = args.slice(1).join(" ")
|
||||||
let reminderTime = currentUnixTime + timeInSeconds
|
let reminderTime = currentUnixTime + timeInSeconds
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue