Year Progress Command

This commit is contained in:
Dragon Fire
2020-10-26 12:20:36 -04:00
parent 37898425b6
commit be510449a9
3 changed files with 25 additions and 3 deletions
+2 -1
View File
@@ -257,7 +257,7 @@ in the appropriate channel's topic to use it.
## Commands
Total: 548
Total: 549
### Utility:
@@ -447,6 +447,7 @@ Total: 548
* **time:** Responds with the current time in a particular location.
* **today-in-history:** Responds with an event that occurred today in history.
* **us-election:** Responds with the odds of each canidate winning the presidential election, according to 538.
* **year-progress:** Responds with the progress of the current year.
### Search:
+21
View File
@@ -0,0 +1,21 @@
const Command = require('../../structures/Command');
module.exports = class YearProgressCommand extends Command {
constructor(client) {
super(client, {
name: 'year-progress',
aliases: ['year', 'year-prog', 'y-progress', 'y-prog'],
group: 'events',
memberName: 'year-progress',
description: 'Responds with the progress of the current year.'
});
}
run(msg) {
const today = new Date();
const start = new Date(today.getFullYear(), 0, 1);
const end = new Date(today.getFullYear() + 1, 0, 1);
const percent = (Math.abs(today - start) / Math.abs(end - start)) * 100;
return msg.say(`The year ${now.getFullYear()} is **${percent}%** complete!`);
}
};
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "119.30.1",
"version": "119.31.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {
@@ -32,7 +32,7 @@
},
"dependencies": {
"@discordjs/collection": "^0.1.6",
"@discordjs/opus": "^0.3.2",
"@discordjs/opus": "^0.3.3",
"@vitalets/google-translate-api": "^4.0.0",
"aki-api": "^5.2.0",
"canvas": "^2.6.1",