-
Couldn't load subscription status.
- Fork 124
Open
Description
I'm using generator arguments and the last option, --name, always returns null when I try to set it.
*args() {
const member = yield {
type: "memberMention",
prompt: {
start: "...",
retry: "...",
},
};
const playlist = yield {
type: (message, phrase) =>
Playlist.resolvePlaylist(phrase, message.client, member.id), // returns null or object
match: "rest",
prompt: {
start: "...",
retry: `...`,
},
};
const name = yield {
type: Argument.validate("string", (m, p, str: string) => str.length <= 20),
match: "option",
flag: ["--name", "-n"],
default: playlist.title,
prompt: {
optional: true,
retry: "Please limit the name to 20 letters and try again",
},
};
return { member, playlist, name };
}If I omit --name then it uses the set default and works fine. However, if I do use --name or -n, it returns null. This is also the case if I don't provide a string after the flag, or if I provide a string over 20 characters. There is no prompting.
Logging parsed.optionFlags at the bottom also returns an empty array.
Metadata
Metadata
Assignees
Labels
No labels