mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
18 lines
348 B
JavaScript
18 lines
348 B
JavaScript
const { ArgumentType } = require('discord.js-commando');
|
|
const { URL } = require('url');
|
|
const validURL = require('valid-url');
|
|
|
|
module.exports = class UrlType extends ArgumentType {
|
|
constructor(client) {
|
|
super(client, 'url');
|
|
}
|
|
|
|
validate(value) {
|
|
return Boolean(validURL.isWebUri(value));
|
|
}
|
|
|
|
parse(value) {
|
|
return new URL(value);
|
|
}
|
|
};
|