diff --git a/README.md b/README.md index 34b90acd..c7410a85 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/commands/events/year-progress.js b/commands/events/year-progress.js new file mode 100644 index 00000000..577e7e03 --- /dev/null +++ b/commands/events/year-progress.js @@ -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!`); + } +}; diff --git a/package.json b/package.json index 5156dbbc..012c1d3f 100644 --- a/package.json +++ b/package.json @@ -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",