Check if the date is in the past
All checks were successful
CI / CI (push) Successful in 1m22s

This commit is contained in:
SileNce5k 2025-05-14 18:21:13 +02:00
parent a16263c04e
commit 24cc4eb26d
Signed by: SileNce
GPG key ID: B0A142BB4291B204

View file

@ -10,6 +10,9 @@ module.exports = async function (message, args) {
let timeInSeconds;
if(Date.parse(args[0]) && parseFloat(args[0]).toString() === args[0]){
timeInSeconds = timeUntil(args[0]);
if(timeUntil.totalInSeconds < 0){
return message.channel.send("The date must not be in the past.");
}
}else {
timeInSeconds = parseTime(args[0], currentUnixTime);
}