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