mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
19 lines
414 B
JavaScript
19 lines
414 B
JavaScript
const { ArgumentType } = require('discord.js-commando');
|
|
const sherlock = require('sherlockjs');
|
|
|
|
module.exports = class SherlockType extends ArgumentType {
|
|
constructor(client) {
|
|
super(client, 'sherlock');
|
|
}
|
|
|
|
validate(value) {
|
|
const time = sherlock.parse(value);
|
|
if (!time.startDate) return 'Please provide a valid starting time.';
|
|
return true;
|
|
}
|
|
|
|
parse(value) {
|
|
return sherlock.parse(value);
|
|
}
|
|
};
|