This is better

This commit is contained in:
Daniel Odendahl Jr
2017-12-31 22:52:37 +00:00
parent 0933c8f318
commit 262b356e90
+5 -3
View File
@@ -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()
} }