mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 08:12:04 +02:00
Year Progress Command
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
@@ -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
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user