mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-08 15:19:14 +02:00
Fix time trimming
This commit is contained in:
@@ -31,8 +31,9 @@ module.exports = class DaysUntilCommand extends Command {
|
||||
let year = now.getMonth() + 1 <= month ? now.getFullYear() : now.getFullYear() + 1;
|
||||
if (month === now.getMonth() + 1 && now.getDate() >= day) ++year;
|
||||
const future = new Date(`${month}/${day}/${year}`);
|
||||
const time = moment.duration(future - now).format('M [months and] d [days]');
|
||||
if (time === 'Invalid date') return msg.reply('Invalid date.');
|
||||
return msg.say(`There are ${time} until ${moment.utc(future).format('dddd, MMMM Do, YYYY')}!`);
|
||||
const futureFormat = moment.utc(future).format('dddd, MMMM Do, YYYY');
|
||||
const time = moment.duration(future - now);
|
||||
const link = time.months() === 1 ? 'is' : 'are';
|
||||
return msg.say(`There ${link} ${time.format('M [months and] d [days]')} until ${futureFormat}!`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@ module.exports = class NekoAtsumePasswordCommand extends Command {
|
||||
const data = await this.fetchPassword(locale);
|
||||
return msg.say(stripIndents`
|
||||
The current Neko Atsume password is **${data.password}**.
|
||||
It will expire in **${moment.duration(data.expires - data.date).format('hh:mm:ss')}**.
|
||||
It will expire in **${moment.duration(data.expires - data.date).format('hh:mm:ss', { trim: false })}**.
|
||||
|
||||
${data.gold} ${this.goldFish} ${data.silver} ${this.silverFish}
|
||||
`);
|
||||
|
||||
@@ -30,7 +30,7 @@ module.exports = class InfoCommand extends Command {
|
||||
.addField('❯ Source Code',
|
||||
source ? `[Here](https://github.com/${XIAO_GITHUB_REPO_USERNAME}/${XIAO_GITHUB_REPO_NAME})` : 'N/A', true)
|
||||
.addField('❯ Memory Usage', `${Math.round(process.memoryUsage().heapUsed / 1024 / 1024)}MB`, true)
|
||||
.addField('❯ Uptime', moment.duration(this.client.uptime).format('hh:mm:ss'), true)
|
||||
.addField('❯ Uptime', moment.duration(this.client.uptime).format('hh:mm:ss', { trim: false }), true)
|
||||
.addField('❯ Version', `v${version}`, true)
|
||||
.addField('❯ Node Version', process.version, true)
|
||||
.addField('❯ Dependencies', this.parseDependencies());
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "91.8.9",
|
||||
"version": "91.8.10",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user