So I am working on a reminder bot, but not as !reminder (Time in s/m/h) but as in !reminder (Specific time such as 20:00), atm I am trying to let the bot calculate the time between the current time and the input time.
This is what I have run:
const config = require("./config.json");
const discord = require("discord.js")
const ms = require("ms");
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
client.on('messageCreate', client => {
let args = message.content.split(" ")
let inputTime = args[0]
let date = new Date();
let timeNow = date.getHours() + ':' + date.getMinutes() + ';' + date.getSeconds();
//let timer = timeNow until inputTime? (How do i calc this)
message.channel.send(`Reminder set for ${timer}`);
setTimeout(() => {
message.channel.send(`Reminder!`);
}, ms(timer));
}
if(!inputTime && !inputTime.includes(':')) return message.reply('Please make use of XX:XX in the mentioned time.')
}); client.login(config.token);