mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-27 14:18:36 +02:00
oneOf
This commit is contained in:
@@ -18,10 +18,7 @@ module.exports = class HoroscopeCommand extends Command {
|
||||
key: 'sign',
|
||||
prompt: `Which sign would you like to get the horoscope for? Either ${list(signs, 'or')}.`,
|
||||
type: 'string',
|
||||
validate: sign => {
|
||||
if (signs.includes(sign.toLowerCase())) return true;
|
||||
return `Invalid sign, please enter either ${list(signs, 'or')}.`;
|
||||
},
|
||||
oneOf: signs,
|
||||
parse: sign => sign.toLowerCase()
|
||||
}
|
||||
]
|
||||
|
||||
@@ -18,10 +18,7 @@ module.exports = class NekoAtsumePasswordCommand extends Command {
|
||||
prompt: `What locale do you want to use? Either ${list(locales, 'or')}.`,
|
||||
type: 'string',
|
||||
default: 'en',
|
||||
validate: locale => {
|
||||
if (locales.includes(locale.toLowerCase())) return true;
|
||||
return `Invalid locale, please enter either ${list(locales, 'or')}.`;
|
||||
},
|
||||
oneOf: locales,
|
||||
parse: locale => locale.toLowerCase()
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user