mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 22:32:52 +02:00
Automaticly use "something" in timer as the title.
This commit is contained in:
@@ -26,11 +26,12 @@ module.exports = class TimerCommand extends Command {
|
|||||||
const timeMs = time.startDate.getTime() - Date.now();
|
const timeMs = time.startDate.getTime() - Date.now();
|
||||||
if (timeMs > 600000) return msg.reply('Times above 10 minutes are not currently supported. Sorry!');
|
if (timeMs > 600000) return msg.reply('Times above 10 minutes are not currently supported. Sorry!');
|
||||||
const display = moment().add(timeMs, 'ms').fromNow();
|
const display = moment().add(timeMs, 'ms').fromNow();
|
||||||
|
const title = time.eventTitle || 'something';
|
||||||
const timeout = setTimeout(async () => {
|
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);
|
this.timers.delete(msg.channel.id);
|
||||||
}, timeMs);
|
}, timeMs);
|
||||||
this.timers.set(msg.channel.id, timeout);
|
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}.`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user