mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 21:40:51 +02:00
Fix
This commit is contained in:
@@ -33,16 +33,16 @@ module.exports = class KinoCommand extends Command {
|
|||||||
\`\`\`
|
\`\`\`
|
||||||
`,
|
`,
|
||||||
type: 'string',
|
type: 'string',
|
||||||
validate: story => {
|
validate: choice => {
|
||||||
if (stories.some(story => story.toLowerCase() === story.toLowerCase())) return true;
|
if (stories.some(story => choice.toLowerCase() === story.toLowerCase())) return true;
|
||||||
const num = Number.parseInt(story, 10);
|
const num = Number.parseInt(choice, 10);
|
||||||
return Boolean(stories[num]);
|
return Boolean(stories[num]);
|
||||||
},
|
},
|
||||||
parse: story => {
|
parse: choice => {
|
||||||
if (stories.some(story => story.toLowerCase() === story.toLowerCase())) {
|
if (stories.some(story => choice.toLowerCase() === story.toLowerCase())) {
|
||||||
return story.toLowerCase();
|
return choice.toLowerCase();
|
||||||
}
|
}
|
||||||
const num = Number.parseInt(story, 10);
|
const num = Number.parseInt(choice, 10);
|
||||||
return stories[num];
|
return stories[num];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user