Make parse-time look nicer

This commit is contained in:
Dragon Fire
2020-11-25 17:50:10 -05:00
parent 16ea8fc640
commit eb25419411
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
const Command = require('../../structures/Command');
const moment = require('moment');
require('moment-duration-format');
module.exports = class ParseTimeCommand extends Command {
constructor(client) {
@@ -20,8 +21,8 @@ module.exports = class ParseTimeCommand extends Command {
}
run(msg, { time }) {
const timeMs = time.startDate.getTime() - Date.now();
const display = moment().add(timeMs, 'ms').fromNow();
const time = moment.duration(Date.now() - time.startDate.getTime());
const display = time.format('Y [years,] M [months,] d [days,] h [hours,] m [minutes and] s [seconds]');
return msg.say(`This time duration parses as **${display}**.`);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "121.2.0",
"version": "121.2.1",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {