mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
oneOf
This commit is contained in:
+32
-32
@@ -1,34 +1,34 @@
|
||||
[
|
||||
"AUD",
|
||||
"USD",
|
||||
"BGN",
|
||||
"BRL",
|
||||
"CAD",
|
||||
"CHF",
|
||||
"CNY",
|
||||
"CZK",
|
||||
"DKK",
|
||||
"GBP",
|
||||
"HKD",
|
||||
"HRK",
|
||||
"HUF",
|
||||
"IDR",
|
||||
"ILS",
|
||||
"INR",
|
||||
"JPY",
|
||||
"KRW",
|
||||
"MXN",
|
||||
"MYR",
|
||||
"NOK",
|
||||
"NZD",
|
||||
"PHP",
|
||||
"PLN",
|
||||
"RON",
|
||||
"RUB",
|
||||
"SEK",
|
||||
"SGD",
|
||||
"THB",
|
||||
"TRY",
|
||||
"ZAR",
|
||||
"EUR"
|
||||
"aud",
|
||||
"usd",
|
||||
"bgn",
|
||||
"brl",
|
||||
"cad",
|
||||
"chf",
|
||||
"cny",
|
||||
"czk",
|
||||
"dkk",
|
||||
"gbp",
|
||||
"hkd",
|
||||
"hrk",
|
||||
"huf",
|
||||
"idr",
|
||||
"ils",
|
||||
"inr",
|
||||
"jpy",
|
||||
"krw",
|
||||
"mxn",
|
||||
"myr",
|
||||
"nok",
|
||||
"nzd",
|
||||
"php",
|
||||
"pln",
|
||||
"ron",
|
||||
"rub",
|
||||
"sek",
|
||||
"sgd",
|
||||
"thb",
|
||||
"try",
|
||||
"zar",
|
||||
"eur"
|
||||
]
|
||||
|
||||
@@ -23,10 +23,7 @@ module.exports = class HatCommand extends Command {
|
||||
key: 'type',
|
||||
prompt: `What type of hat would you like to use? Either ${list(hats, 'or')}.`,
|
||||
type: 'string',
|
||||
validate: type => {
|
||||
if (hats.includes(type.toLowerCase())) return true;
|
||||
return `Invalid type, please enter either ${list(hats, 'or')}.`;
|
||||
},
|
||||
oneOf: hats,
|
||||
parse: type => type.toLowerCase()
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
]
|
||||
|
||||
@@ -25,10 +25,7 @@ module.exports = class MathQuizCommand extends Command {
|
||||
key: 'difficulty',
|
||||
prompt: `What should the difficulty of the game be? Either ${list(difficulties, 'or')}.`,
|
||||
type: 'string',
|
||||
validate: difficulty => {
|
||||
if (difficulties.includes(difficulty.toLowerCase())) return true;
|
||||
return `Invalid difficulty, please enter either ${list(difficulties, 'or')}.`;
|
||||
},
|
||||
oneOf: difficulties,
|
||||
parse: difficulty => difficulty.toLowerCase()
|
||||
}
|
||||
]
|
||||
|
||||
@@ -24,10 +24,7 @@ module.exports = class QuizCommand extends Command {
|
||||
prompt: `Which type of question would you like to have? Either ${list(types, 'or')}.`,
|
||||
type: 'string',
|
||||
default: 'multiple',
|
||||
validate: type => {
|
||||
if (types.includes(type.toLowerCase())) return true;
|
||||
return `Invalid type, please enter either ${list(types, 'or')}.`;
|
||||
},
|
||||
oneOf: types,
|
||||
parse: type => type.toLowerCase()
|
||||
},
|
||||
{
|
||||
@@ -35,10 +32,7 @@ module.exports = class QuizCommand extends Command {
|
||||
prompt: `What should the difficulty of the game be? Either ${list(difficulties, 'or')}.`,
|
||||
type: 'string',
|
||||
default: '',
|
||||
validate: difficulty => {
|
||||
if (difficulties.includes(difficulty.toLowerCase())) return true;
|
||||
return `Invalid difficulty, please enter either ${list(difficulties, 'or')}.`;
|
||||
},
|
||||
oneOf: difficulties,
|
||||
parse: difficulty => difficulty.toLowerCase()
|
||||
}
|
||||
]
|
||||
|
||||
@@ -25,10 +25,7 @@ module.exports = class TypingTestCommand extends Command {
|
||||
key: 'difficulty',
|
||||
prompt: `What should the difficulty of the game be? Either ${list(difficulties, 'or')}.`,
|
||||
type: 'string',
|
||||
validate: difficulty => {
|
||||
if (difficulties.includes(difficulty.toLowerCase())) return true;
|
||||
return `Invalid difficulty, please enter either ${list(difficulties, 'or')}.`;
|
||||
},
|
||||
oneOf: difficulties,
|
||||
parse: difficulty => difficulty.toLowerCase()
|
||||
}
|
||||
]
|
||||
|
||||
@@ -32,10 +32,7 @@ module.exports = class IllegalCommand extends Command {
|
||||
prompt: 'Should the text use is, are, or am?',
|
||||
type: 'string',
|
||||
default: 'IS',
|
||||
validate: verb => {
|
||||
if (['is', 'are', 'am'].includes(verb.toLowerCase())) return true;
|
||||
return 'Invalid verb, please enter either is, are, or am.';
|
||||
},
|
||||
oneOf: ['is', 'are', 'am'],
|
||||
parse: verb => verb.toUpperCase()
|
||||
}
|
||||
]
|
||||
|
||||
@@ -17,10 +17,7 @@ module.exports = class EmojiListCommand extends Command {
|
||||
prompt: `What type of emoji would you like to view? Either ${list(types, 'or')}.`,
|
||||
type: 'string',
|
||||
default: 'regular',
|
||||
validate: type => {
|
||||
if (types.includes(type.toLowerCase())) return true;
|
||||
return `Invalid type, please enter either ${list(types, 'or')}.`;
|
||||
},
|
||||
oneOf: types,
|
||||
parse: type => type.toLowerCase()
|
||||
}
|
||||
]
|
||||
|
||||
@@ -22,20 +22,14 @@ module.exports = class CurrencyCommand extends Command {
|
||||
key: 'base',
|
||||
prompt: `What currency code do you want to use as the base? Either ${list(codes, 'or')}.`,
|
||||
type: 'string',
|
||||
validate: base => {
|
||||
if (codes.includes(base.toUpperCase())) return true;
|
||||
return `Invalid base, please enter either ${list(codes, 'or')}.`;
|
||||
},
|
||||
oneOf: codes,
|
||||
parse: base => base.toUpperCase()
|
||||
},
|
||||
{
|
||||
key: 'target',
|
||||
prompt: `What currency code do you want to convert to? Either ${list(codes, 'or')}.`,
|
||||
type: 'string',
|
||||
validate: target => {
|
||||
if (codes.includes(target.toUpperCase())) return true;
|
||||
return `Invalid target, please enter either ${list(codes, 'or')}.`;
|
||||
},
|
||||
oneOf: codes,
|
||||
parse: target => target.toUpperCase()
|
||||
}
|
||||
]
|
||||
|
||||
@@ -17,10 +17,7 @@ module.exports = class NameCommand extends Command {
|
||||
prompt: `Which gender do you want to generate a name for? Either ${list(genders, 'or')}.`,
|
||||
type: 'string',
|
||||
default: 'both',
|
||||
validate: gender => {
|
||||
if (genders.includes(gender.toLowerCase())) return true;
|
||||
return `Invalid gender, please enter either ${list(genders, 'or')}.`;
|
||||
},
|
||||
oneOf: genders,
|
||||
parse: gender => gender.toLowerCase()
|
||||
}
|
||||
]
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
]
|
||||
|
||||
@@ -16,10 +16,7 @@ module.exports = class Base64Command extends Command {
|
||||
key: 'mode',
|
||||
prompt: `Would you like to ${list(modes, 'or')}?`,
|
||||
type: 'string',
|
||||
validate: mode => {
|
||||
if (modes.includes(mode.toLowerCase())) return true;
|
||||
return `Invalid mode, please enter either ${list(modes, 'or')}.`;
|
||||
},
|
||||
oneOf: modes,
|
||||
parse: mode => mode.toLowerCase()
|
||||
},
|
||||
{
|
||||
|
||||
@@ -15,10 +15,7 @@ module.exports = class BinaryCommand extends Command {
|
||||
key: 'mode',
|
||||
prompt: `Would you like to ${list(modes, 'or')}?`,
|
||||
type: 'string',
|
||||
validate: mode => {
|
||||
if (modes.includes(mode.toLowerCase())) return true;
|
||||
return `Invalid mode, please enter either ${list(modes, 'or')}.`;
|
||||
},
|
||||
oneOf: modes,
|
||||
parse: mode => mode.toLowerCase()
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user