mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +02:00
oneOf
This commit is contained in:
@@ -17,10 +17,7 @@ module.exports = class DeviantartCommand extends Command {
|
||||
key: 'section',
|
||||
prompt: `What section would you like to search? Either ${list(sections, 'or')}.`,
|
||||
type: 'string',
|
||||
validate: section => {
|
||||
if (sections.includes(section.toLowerCase())) return true;
|
||||
return `Invalid section, please enter either ${list(sections, 'or')}.`;
|
||||
},
|
||||
oneOf: sections,
|
||||
parse: section => section.toLowerCase()
|
||||
},
|
||||
{
|
||||
|
||||
@@ -25,10 +25,7 @@ module.exports = class UrbanDictionaryCommand extends Command {
|
||||
prompt: 'Do you want to get the top answer or a random one?',
|
||||
type: 'string',
|
||||
default: 'top',
|
||||
validate: type => {
|
||||
if (types.includes(type.toLowerCase())) return true;
|
||||
return `Invalid type, please enter either ${list(types, 'or')}.`;
|
||||
},
|
||||
oneOf: types,
|
||||
parse: type => type.toLowerCase()
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user