mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-10 19:04:42 +02:00
Add examples
This commit is contained in:
@@ -34,4 +34,8 @@ module.exports = class FontArgument extends Argument {
|
||||
if (foundExact.size === 1) return foundExact.first();
|
||||
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)
|
||||
&& 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 request = require('node-superfetch');
|
||||
const validURL = require('valid-url');
|
||||
const logos = require('../../assets/json/logos');
|
||||
const logoKeys = Object.keys(logos);
|
||||
|
||||
module.exports = class ImageArgument extends Argument {
|
||||
constructor(client) {
|
||||
@@ -41,4 +43,8 @@ module.exports = class ImageArgument extends Argument {
|
||||
if (msg.attachments.size) return false;
|
||||
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;
|
||||
return null;
|
||||
}
|
||||
|
||||
example() {
|
||||
return months[Math.floor(Math.random() * months.length)];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
const Argument = require('../framework/ArgumentType');
|
||||
const examples = ['Pikachu', 'Bulbasaur', 'Victini', 'Flygon'];
|
||||
|
||||
module.exports = class PokemonArgument extends Argument {
|
||||
constructor(client) {
|
||||
@@ -14,4 +15,9 @@ module.exports = class PokemonArgument extends Argument {
|
||||
parse(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) {
|
||||
return sherlock.parse(value);
|
||||
}
|
||||
|
||||
example() {
|
||||
return 'sleep 1 hour';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -37,4 +37,9 @@ module.exports = class TimezoneType extends Argument {
|
||||
}
|
||||
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}`);
|
||||
return new URL(value);
|
||||
}
|
||||
|
||||
example() {
|
||||
return '<https://discord.com>';
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user