mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Days Until support year, message jump cleaner
This commit is contained in:
@@ -22,15 +22,24 @@ module.exports = class DaysUntilCommand extends Command {
|
||||
type: 'integer',
|
||||
min: 1,
|
||||
max: 31
|
||||
},
|
||||
{
|
||||
key: 'year',
|
||||
prompt: 'What year would you like to get the days until?',
|
||||
type: 'integer',
|
||||
min: new Date().getFullYear(),
|
||||
default: ''
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
run(msg, { month, day }) {
|
||||
run(msg, { month, day, year }) {
|
||||
const now = new Date();
|
||||
let year = now.getMonth() + 1 <= month ? now.getFullYear() : now.getFullYear() + 1;
|
||||
if (month === now.getMonth() + 1 && now.getDate() >= day) ++year;
|
||||
if (!year) {
|
||||
year = now.getMonth() + 1 <= month ? now.getFullYear() : now.getFullYear() + 1;
|
||||
if (month === now.getMonth() + 1 && now.getDate() >= day) ++year;
|
||||
}
|
||||
const future = new Date(year, month - 1, day);
|
||||
const futureFormat = moment.utc(future).format('dddd, MMMM Do, YYYY');
|
||||
const time = moment.duration(future - now);
|
||||
|
||||
@@ -34,7 +34,7 @@ module.exports = class FirstMessageCommand extends Command {
|
||||
.setDescription(message.content)
|
||||
.setTimestamp(message.createdAt)
|
||||
.setFooter(`ID: ${message.id}`)
|
||||
.addField('❯ Jump', message.url);
|
||||
.addField('❯ Jump', `[Click Here to Jump](${message.url})`);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -30,7 +30,7 @@ module.exports = class MessageCommand extends Command {
|
||||
.setDescription(message.content)
|
||||
.setTimestamp(message.createdAt)
|
||||
.setFooter(`ID: ${message.id}`)
|
||||
.addField('❯ Jump', message.url);
|
||||
.addField('❯ Jump', `[Click Here to Jump](${message.url})`);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
|
||||
+3
-3
@@ -34,7 +34,7 @@
|
||||
"@discordjs/collection": "^0.1.6",
|
||||
"@discordjs/opus": "^0.3.3",
|
||||
"@vitalets/google-translate-api": "^4.0.0",
|
||||
"aki-api": "^5.2.0",
|
||||
"aki-api": "^5.2.1",
|
||||
"canvas": "^2.6.1",
|
||||
"cheerio": "^1.0.0-rc.5",
|
||||
"cloc": "^2.7.0",
|
||||
@@ -50,7 +50,7 @@
|
||||
"gm": "^1.23.1",
|
||||
"html-entities": "^2.0.2",
|
||||
"ioredis": "^4.19.4",
|
||||
"js-beautify": "^1.13.0",
|
||||
"js-beautify": "^1.13.1",
|
||||
"mathjs": "^8.1.1",
|
||||
"moment": "^2.29.1",
|
||||
"moment-duration-format": "^2.3.2",
|
||||
@@ -69,7 +69,7 @@
|
||||
"bufferutil": "^4.0.3",
|
||||
"erlpack": "github:discord/erlpack",
|
||||
"sodium": "^3.0.2",
|
||||
"utf-8-validate": "^5.0.3",
|
||||
"utf-8-validate": "^5.0.4",
|
||||
"zlib-sync": "^0.1.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user