mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Add examples
This commit is contained in:
@@ -44,24 +44,17 @@ module.exports = class EjectCommand extends Command {
|
|||||||
key: 'user',
|
key: 'user',
|
||||||
type: 'user',
|
type: 'user',
|
||||||
default: msg => msg.author
|
default: msg => msg.author
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'imposter',
|
|
||||||
type: 'boolean',
|
|
||||||
default: ''
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async run(msg, { user, imposter }) {
|
async run(msg, { user }) {
|
||||||
const avatarURL = user.displayAvatarURL({ extension: 'png', size: 128 });
|
const avatarURL = user.displayAvatarURL({ extension: 'png', size: 128 });
|
||||||
const { body } = await request.get(avatarURL);
|
const { body } = await request.get(avatarURL);
|
||||||
const avatar = await loadImage(body);
|
const avatar = await loadImage(body);
|
||||||
if (imposter === '') {
|
const random = MersenneTwister19937.seed(user.id);
|
||||||
const random = MersenneTwister19937.seed(user.id);
|
const imposter = bool()(random);
|
||||||
imposter = bool()(random);
|
|
||||||
}
|
|
||||||
const text = `${user.username} was${imposter ? ' ' : ' not '}An Imposter.`;
|
const text = `${user.username} was${imposter ? ' ' : ' not '}An Imposter.`;
|
||||||
const encoder = new GIFEncoder(320, 180);
|
const encoder = new GIFEncoder(320, 180);
|
||||||
const canvas = createCanvas(320, 180);
|
const canvas = createCanvas(320, 180);
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ module.exports = class HelpCommand extends Command {
|
|||||||
cmdHelpText += `**Flags:**\n${flags}\n`;
|
cmdHelpText += `**Flags:**\n${flags}\n`;
|
||||||
}
|
}
|
||||||
cmdHelpText += `**Format:** ${command.usage()}\n`;
|
cmdHelpText += `**Format:** ${command.usage()}\n`;
|
||||||
|
cmdHelpText += `**Example:** ${command.example(msg)}\n`;
|
||||||
if (command.aliases.length) cmdHelpText += `**Aliases:** ${command.aliases.join(', ')}\n`;
|
if (command.aliases.length) cmdHelpText += `**Aliases:** ${command.aliases.join(', ')}\n`;
|
||||||
cmdHelpText += `**Group:** ${command.group.name}\n`;
|
cmdHelpText += `**Group:** ${command.group.name}\n`;
|
||||||
return msg.say(cmdHelpText);
|
return msg.say(cmdHelpText);
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ module.exports = class Argument {
|
|||||||
this.default = typeof options.default === 'undefined' ? null : options.default;
|
this.default = typeof options.default === 'undefined' ? null : options.default;
|
||||||
this.infinite = Boolean(options.infinite);
|
this.infinite = Boolean(options.infinite);
|
||||||
this.avatarSize = typeof options.avatarSize === 'undefined' ? 2048 : options.avatarSize;
|
this.avatarSize = typeof options.avatarSize === 'undefined' ? 2048 : options.avatarSize;
|
||||||
|
this.examples = typeof options.examples === 'undefined' ? null : options.examples;
|
||||||
this.validator = typeof options.validate === 'undefined' ? null : options.validate;
|
this.validator = typeof options.validate === 'undefined' ? null : options.validate;
|
||||||
this.parser = typeof options.parse === 'undefined' ? null : options.parse;
|
this.parser = typeof options.parse === 'undefined' ? null : options.parse;
|
||||||
this.emptyChecker = typeof options.isEmpty === 'undefined' ? null : options.isEmpty;
|
this.emptyChecker = typeof options.isEmpty === 'undefined' ? null : options.isEmpty;
|
||||||
@@ -40,6 +41,11 @@ module.exports = class Argument {
|
|||||||
return this.type.isEmpty(val, msg, arg);
|
return this.type.isEmpty(val, msg, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example(msg, arg) {
|
||||||
|
if (this.examples) return this.examples[Math.floor(Math.random() * this.examples.length)];
|
||||||
|
return this.type.example(msg, arg);
|
||||||
|
}
|
||||||
|
|
||||||
get invalidText() {
|
get invalidText() {
|
||||||
if (this.oneOf) {
|
if (this.oneOf) {
|
||||||
return `It must be one of the following: ${list(this.oneOf, 'or')}`;
|
return `It must be one of the following: ${list(this.oneOf, 'or')}`;
|
||||||
|
|||||||
@@ -16,4 +16,8 @@ module.exports = class ArgumentType {
|
|||||||
isEmpty(val) {
|
isEmpty(val) {
|
||||||
return !val;
|
return !val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example() {
|
||||||
|
return 'moo';
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -49,6 +49,17 @@ module.exports = class Command {
|
|||||||
return `\`${this.client.commandPrefix}${this.name}${args}\` or \`@${this.client.user.tag} ${this.name}${args}\``;
|
return `\`${this.client.commandPrefix}${this.name}${args}\` or \`@${this.client.user.tag} ${this.name}${args}\``;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example(msg) {
|
||||||
|
const args = this.args.map((arg, i) => {
|
||||||
|
const example = arg.example(msg, arg);
|
||||||
|
if (i !== args.length - 1 && example.includes(' ')) {
|
||||||
|
return `"${example}"`;
|
||||||
|
}
|
||||||
|
return example;
|
||||||
|
});
|
||||||
|
return `${this.client.commandPrefix}${this.name} ${args.join(' ')}`;
|
||||||
|
}
|
||||||
|
|
||||||
disable() {
|
disable() {
|
||||||
this._enabled = false;
|
this._enabled = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ module.exports = class CommandDispatcher {
|
|||||||
error: stripIndents`
|
error: stripIndents`
|
||||||
The "${arg.label || arg.key}" argument is required.
|
The "${arg.label || arg.key}" argument is required.
|
||||||
${arg.invalidText}
|
${arg.invalidText}
|
||||||
|
Correct Usage Example: ${command.example(msg)}
|
||||||
`
|
`
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -75,6 +76,7 @@ module.exports = class CommandDispatcher {
|
|||||||
error: stripIndents`
|
error: stripIndents`
|
||||||
An invalid value was provided for one of the "${arg.label || arg.key}" arguments.
|
An invalid value was provided for one of the "${arg.label || arg.key}" arguments.
|
||||||
${arg.invalidText}
|
${arg.invalidText}
|
||||||
|
Correct Usage Example: ${command.example(msg)}
|
||||||
`
|
`
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -91,6 +93,7 @@ module.exports = class CommandDispatcher {
|
|||||||
error: stripIndents`
|
error: stripIndents`
|
||||||
The "${arg.label || arg.key}" argument is required.
|
The "${arg.label || arg.key}" argument is required.
|
||||||
${arg.invalidText}
|
${arg.invalidText}
|
||||||
|
Correct Usage Example: ${command.example(msg)}
|
||||||
`
|
`
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
@@ -107,6 +110,7 @@ module.exports = class CommandDispatcher {
|
|||||||
error: stripIndents`
|
error: stripIndents`
|
||||||
An invalid value was provided for the "${arg.label || arg.key}" argument.
|
An invalid value was provided for the "${arg.label || arg.key}" argument.
|
||||||
${arg.invalidText}
|
${arg.invalidText}
|
||||||
|
Correct Usage Example: ${command.example(msg)}
|
||||||
`
|
`
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
const ArgumentType = require('../ArgumentType');
|
|
||||||
|
|
||||||
module.exports = class BooleanArgumentType extends ArgumentType {
|
|
||||||
constructor(client) {
|
|
||||||
super(client, 'boolean');
|
|
||||||
this.truthy = new Set(['true', 't', 'yes', 'y', 'on', 'enable', 'enabled', '1', '+']);
|
|
||||||
this.falsy = new Set(['false', 'f', 'no', 'n', 'off', 'disable', 'disabled', '0', '-']);
|
|
||||||
}
|
|
||||||
|
|
||||||
validate(val) {
|
|
||||||
const lc = val.toLowerCase();
|
|
||||||
return this.truthy.has(lc) || this.falsy.has(lc);
|
|
||||||
}
|
|
||||||
|
|
||||||
parse(val) {
|
|
||||||
const lc = val.toLowerCase();
|
|
||||||
if (this.truthy.has(lc)) return true;
|
|
||||||
if (this.falsy.has(lc)) return false;
|
|
||||||
throw new RangeError('Unknown boolean value.');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -28,6 +28,10 @@ module.exports = class ChannelArgumentType extends ArgumentType {
|
|||||||
if (exactChannels.size === 1) return exactChannels.first();
|
if (exactChannels.size === 1) return exactChannels.first();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example() {
|
||||||
|
return '#general';
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function nameFilterExact(search) {
|
function nameFilterExact(search) {
|
||||||
|
|||||||
@@ -14,4 +14,8 @@ module.exports = class CommandArgumentType extends ArgumentType {
|
|||||||
parse(val) {
|
parse(val) {
|
||||||
return this.client.registry.findCommands(val).first();
|
return this.client.registry.findCommands(val).first();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example() {
|
||||||
|
return this.client.registry.commands.random().name;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -29,6 +29,11 @@ module.exports = class CustomEmojiArgumentType extends ArgumentType {
|
|||||||
if (exactEmojis.size === 1) return exactEmojis.first();
|
if (exactEmojis.size === 1) return exactEmojis.first();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example(msg) {
|
||||||
|
if (msg.guild && msg.guild.emojis.cache.size) return msg.guild.emojis.cache.random().toString();
|
||||||
|
return this.client.emojis.cache.random().toString();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function nameFilterExact(search) {
|
function nameFilterExact(search) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
const ArgumentType = require('../ArgumentType');
|
const ArgumentType = require('../ArgumentType');
|
||||||
const emojiRegex = require('emoji-regex')();
|
const emojiRegex = require('emoji-regex')();
|
||||||
|
const examples = ['😄', '🏳️🌈', '🦑', '🦆'];
|
||||||
|
|
||||||
module.exports = class DefaultEmojiArgumentType extends ArgumentType {
|
module.exports = class DefaultEmojiArgumentType extends ArgumentType {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -14,4 +15,8 @@ module.exports = class DefaultEmojiArgumentType extends ArgumentType {
|
|||||||
parse(value) {
|
parse(value) {
|
||||||
return value.match(emojiRegex)[0];
|
return value.match(emojiRegex)[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example() {
|
||||||
|
return examples[Math.floor(Math.random() * examples.length)];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
const ArgumentType = require('../ArgumentType');
|
const ArgumentType = require('../ArgumentType');
|
||||||
|
const { randomRange } = require('../../util/Util');
|
||||||
|
|
||||||
module.exports = class FloatArgumentType extends ArgumentType {
|
module.exports = class FloatArgumentType extends ArgumentType {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -17,4 +18,11 @@ module.exports = class FloatArgumentType extends ArgumentType {
|
|||||||
parse(val) {
|
parse(val) {
|
||||||
return Number.parseFloat(val);
|
return Number.parseFloat(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example(msg, arg) {
|
||||||
|
if (arg.oneOf) return arg.oneOf[Math.floor(Math.random() * arg.oneOf.length)];
|
||||||
|
const min = arg.min || 0;
|
||||||
|
const max = arg.max || 1000;
|
||||||
|
return randomRange(min, max);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -14,4 +14,8 @@ module.exports = class GroupArgumentType extends ArgumentType {
|
|||||||
parse(val) {
|
parse(val) {
|
||||||
return this.client.registry.findGroups(val).first();
|
return this.client.registry.findGroups(val).first();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example() {
|
||||||
|
return this.client.registry.groups.random().id;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
const ArgumentType = require('../ArgumentType');
|
const ArgumentType = require('../ArgumentType');
|
||||||
|
const { randomRange } = require('../../util/Util');
|
||||||
|
|
||||||
module.exports = class IntegerArgumentType extends ArgumentType {
|
module.exports = class IntegerArgumentType extends ArgumentType {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -17,4 +18,11 @@ module.exports = class IntegerArgumentType extends ArgumentType {
|
|||||||
parse(val) {
|
parse(val) {
|
||||||
return Number.parseInt(val, 10);
|
return Number.parseInt(val, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example(msg, arg) {
|
||||||
|
if (arg.oneOf) return arg.oneOf[Math.floor(Math.random() * arg.oneOf.length)];
|
||||||
|
const min = arg.min || 0;
|
||||||
|
const max = arg.max || 1000;
|
||||||
|
return randomRange(min, max);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -36,6 +36,12 @@ module.exports = class MemberArgumentType extends ArgumentType {
|
|||||||
if (exactMembers.size === 1) return exactMembers.first();
|
if (exactMembers.size === 1) return exactMembers.first();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example(msg) {
|
||||||
|
if (msg.guild) return msg.guild.members.cache.random().tag;
|
||||||
|
const members = [this.client.user, msg.channel.recipient];
|
||||||
|
return members[Math.floor(Math.random() * members.length)].tag;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function memberFilterExact(search) {
|
function memberFilterExact(search) {
|
||||||
|
|||||||
@@ -13,4 +13,8 @@ module.exports = class MessageArgumentType extends ArgumentType {
|
|||||||
parse(val, msg) {
|
parse(val, msg) {
|
||||||
return msg.channel.messages.cache.get(val);
|
return msg.channel.messages.cache.get(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example(msg) {
|
||||||
|
return msg.id;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -28,6 +28,11 @@ module.exports = class RoleArgumentType extends ArgumentType {
|
|||||||
if (exactRoles.size === 1) return exactRoles.first();
|
if (exactRoles.size === 1) return exactRoles.first();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example(msg) {
|
||||||
|
if (!msg.guild) return 'Administrator';
|
||||||
|
return msg.guild.roles.cache.random().name;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function nameFilterExact(search) {
|
function nameFilterExact(search) {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
const ArgumentType = require('../ArgumentType');
|
const ArgumentType = require('../ArgumentType');
|
||||||
|
const words = require('../../assets/json/word-list');
|
||||||
|
|
||||||
module.exports = class StringArgumentType extends ArgumentType {
|
module.exports = class StringArgumentType extends ArgumentType {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -15,4 +16,15 @@ module.exports = class StringArgumentType extends ArgumentType {
|
|||||||
parse(val) {
|
parse(val) {
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example(msg, arg) {
|
||||||
|
if (arg.oneOf) return arg.oneOf[Math.floor(Math.random() * arg.oneOf.length)];
|
||||||
|
let sentence = '';
|
||||||
|
while (sentence.length <= (arg.min || 50) || sentence.length <= (arg.max || 100)) {
|
||||||
|
const valid = words.filter(word => sentence.length + word.length + 1 <= (arg.max || 100));
|
||||||
|
if (!valid.length) break;
|
||||||
|
sentence += ` ${valid[Math.floor(Math.random() * valid.length)]}`;
|
||||||
|
}
|
||||||
|
return sentence.trim();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -38,6 +38,12 @@ module.exports = class UserArgumentType extends ArgumentType {
|
|||||||
if (exactMembers.size === 1) return exactMembers.first().user;
|
if (exactMembers.size === 1) return exactMembers.first().user;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example(msg) {
|
||||||
|
if (msg.guild) return msg.guild.members.cache.random().tag;
|
||||||
|
const members = [this.client.user, msg.channel.recipient];
|
||||||
|
return members[Math.floor(Math.random() * members.length)].tag;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function memberFilterExact(search) {
|
function memberFilterExact(search) {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "151.2.1",
|
"version": "151.3.0",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
@@ -34,4 +34,8 @@ module.exports = class FontArgument extends Argument {
|
|||||||
if (foundExact.size === 1) return foundExact.first();
|
if (foundExact.size === 1) return foundExact.first();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example() {
|
||||||
|
return this.client.fonts.random().filenameNoExt;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,4 +22,8 @@ module.exports = class ImageOrAvatarArgument extends Argument {
|
|||||||
return this.client.registry.types.get('image').isEmpty(value, msg, arg)
|
return this.client.registry.types.get('image').isEmpty(value, msg, arg)
|
||||||
&& this.client.registry.types.get('user').isEmpty(value, msg, arg);
|
&& this.client.registry.types.get('user').isEmpty(value, msg, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example(msg, arg) {
|
||||||
|
return this.client.registry.types.get('user').example(msg, arg);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ const Argument = require('../framework/ArgumentType');
|
|||||||
const fileTypeRe = /\.(jpe?g|png|gif|jfif|bmp)(\?.+)?$/i;
|
const fileTypeRe = /\.(jpe?g|png|gif|jfif|bmp)(\?.+)?$/i;
|
||||||
const request = require('node-superfetch');
|
const request = require('node-superfetch');
|
||||||
const validURL = require('valid-url');
|
const validURL = require('valid-url');
|
||||||
|
const logos = require('../../assets/json/logos');
|
||||||
|
const logoKeys = Object.keys(logos);
|
||||||
|
|
||||||
module.exports = class ImageArgument extends Argument {
|
module.exports = class ImageArgument extends Argument {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -41,4 +43,8 @@ module.exports = class ImageArgument extends Argument {
|
|||||||
if (msg.attachments.size) return false;
|
if (msg.attachments.size) return false;
|
||||||
return !value;
|
return !value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example() {
|
||||||
|
return `<${logos[logoKeys[Math.floor(Math.random() * logoKeys.length)]]}>`;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -21,4 +21,8 @@ module.exports = class MonthArgument extends Argument {
|
|||||||
if (shorthand.includes(value.toLowerCase())) return shorthand.indexOf(value.toLowerCase()) + 1;
|
if (shorthand.includes(value.toLowerCase())) return shorthand.indexOf(value.toLowerCase()) + 1;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example() {
|
||||||
|
return months[Math.floor(Math.random() * months.length)];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
const Argument = require('../framework/ArgumentType');
|
const Argument = require('../framework/ArgumentType');
|
||||||
|
const examples = ['Pikachu', 'Bulbasaur', 'Victini', 'Flygon'];
|
||||||
|
|
||||||
module.exports = class PokemonArgument extends Argument {
|
module.exports = class PokemonArgument extends Argument {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -14,4 +15,9 @@ module.exports = class PokemonArgument extends Argument {
|
|||||||
parse(value) {
|
parse(value) {
|
||||||
return this.client.pokemon.fetch(value);
|
return this.client.pokemon.fetch(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example() {
|
||||||
|
if (this.client.pokemon.size) return this.client.pokemon.random().name;
|
||||||
|
return examples[Math.floor(Math.random() * examples.length)];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,4 +15,8 @@ module.exports = class SherlockType extends Argument {
|
|||||||
parse(value) {
|
parse(value) {
|
||||||
return sherlock.parse(value);
|
return sherlock.parse(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example() {
|
||||||
|
return 'sleep 1 hour';
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -37,4 +37,9 @@ module.exports = class TimezoneType extends Argument {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example() {
|
||||||
|
const zones = moment.tz.names();
|
||||||
|
return zones[Math.floor(Math.random() * zones.length)];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,4 +15,8 @@ module.exports = class UrlType extends Argument {
|
|||||||
if (!validURL.isWebUri(value)) return new URL(`http://${value}`);
|
if (!validURL.isWebUri(value)) return new URL(`http://${value}`);
|
||||||
return new URL(value);
|
return new URL(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
example() {
|
||||||
|
return '<https://discord.com>';
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user