choice argument type

This commit is contained in:
Daniel Odendahl Jr
2018-03-17 13:02:45 +00:00
parent 7c12d04e42
commit 679bb538cb
17 changed files with 84 additions and 121 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ module.exports = class ChannelInfoCommand extends Command {
const embed = new MessageEmbed()
.setColor(0x00AE86)
.addField(' Name',
channel.name || 'None', true)
channel.type !== 'dm' ? channel.name : `@${channel.recipient.username}`, true)
.addField(' ID',
channel.id, true)
.addField(' NSFW',
+2 -6
View File
@@ -15,13 +15,9 @@ module.exports = class EmojiListCommand extends Command {
{
key: 'type',
prompt: `What type of emoji would you like to view? Either ${list(types, 'or')}.`,
type: 'string',
type: 'choice',
default: 'regular',
validate: type => {
if (types.includes(type.toLowerCase())) return true;
return `Invalid type, please enter either ${list(types, 'or')}.`;
},
parse: type => type.toLowerCase()
choices: types
}
]
});