Return text to send instead of sending in util function
This commit is contained in:
parent
17e7aa3dbb
commit
0dc6af5984
1 changed files with 3 additions and 3 deletions
|
@ -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 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 timeInSeconds;
|
||||
if(!isNaN(Date.parse(args[0])) && isNaN(parseTime(args[0]))){
|
||||
timeInSeconds = timeUntil(args[0]).totalInSeconds;
|
||||
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 {
|
||||
timeInSeconds = parseTime(args[0], currentUnixTime);
|
||||
}
|
||||
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 reminderTime = currentUnixTime + timeInSeconds
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue