Automaticly use "something" in timer as the title.

This commit is contained in:
Dragon Fire
2020-11-13 17:06:31 -05:00
parent 84dd277ecf
commit 29f1be6f2c
+3 -2
View File
@@ -26,11 +26,12 @@ module.exports = class TimerCommand extends Command {
const timeMs = time.startDate.getTime() - Date.now();
if (timeMs > 600000) return msg.reply('Times above 10 minutes are not currently supported. Sorry!');
const display = moment().add(timeMs, 'ms').fromNow();
const title = time.eventTitle || 'something';
const timeout = setTimeout(async () => {
await msg.channel.send(`🕰️ ${msg.author}, you wanted me to remind you of: **"${time.eventTitle}"**.`);
await msg.channel.send(`🕰️ ${msg.author}, you wanted me to remind you of: **"${title}"**.`);
this.timers.delete(msg.channel.id);
}, timeMs);
this.timers.set(msg.channel.id, timeout);
return msg.say(`🕰️ Okay, I will remind you **"${time.eventTitle}"** ${display}.`);
return msg.say(`🕰️ Okay, I will remind you **"${title}"** ${display}.`);
}
};