mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 22:27:44 +02:00
This is better
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
const { Command } = require('discord.js-commando');
|
const { Command } = require('discord.js-commando');
|
||||||
|
const { list } = require('../../util/Util');
|
||||||
|
const types = ['animated', 'regular'];
|
||||||
|
|
||||||
module.exports = class EmojiListCommand extends Command {
|
module.exports = class EmojiListCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -12,12 +14,12 @@ module.exports = class EmojiListCommand extends Command {
|
|||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
key: 'type',
|
key: 'type',
|
||||||
prompt: 'Would you like to view animated emoji or regular emoji?',
|
prompt: `What type of emoji would you like to view? Either ${list(types, 'or')}.`,
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: 'regular',
|
default: 'regular',
|
||||||
validate: type => {
|
validate: type => {
|
||||||
if (['animated', 'regular'].includes(type.toLowerCase())) return true;
|
if (types.includes(type.toLowerCase())) return true;
|
||||||
return 'Invalid type, please enter either animated or regular.';
|
return `Invalid type, please enter either ${list(types, 'or')}.`;
|
||||||
},
|
},
|
||||||
parse: type => type.toLowerCase()
|
parse: type => type.toLowerCase()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user