mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-13 00:09:08 +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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user