mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-11 15:57:50 +02:00
Parse Time Command
This commit is contained in:
@@ -268,7 +268,7 @@ in the appropriate channel's topic to use it.
|
||||
|
||||
## Commands
|
||||
|
||||
Total: 561
|
||||
Total: 562
|
||||
|
||||
### Utility:
|
||||
|
||||
@@ -548,6 +548,7 @@ Total: 561
|
||||
* **has-transparency:** Determines if an image has transparency in it.
|
||||
* **image-size:** Determines the size of an image.
|
||||
* **ocr:** Performs Optical Character Recognition on an image.
|
||||
* **parse-time:** Analyzes the time duration you provide and gives the result.
|
||||
* **read-qr-code:** Reads a QR Code.
|
||||
* **safe-url:** Determines if a URL is safe or not.
|
||||
* **scrabble-score:** Responds with the scrabble score of a word.
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const moment = require('moment');
|
||||
|
||||
module.exports = class ParseTimeCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'parse-time',
|
||||
aliases: ['analyze-time', 'sherlock'],
|
||||
group: 'analyze',
|
||||
memberName: 'parse-time',
|
||||
description: 'Analyzes the time duration you provide and gives the result.',
|
||||
args: [
|
||||
{
|
||||
key: 'time',
|
||||
prompt: 'What do you want me to analyze?',
|
||||
type: 'sherlock'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { time }) {
|
||||
const timeMs = time.startDate.getTime() - Date.now();
|
||||
const display = moment().add(timeMs, 'ms').fromNow();
|
||||
return msg.say(`This time duration parses as **${display}**.`);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user