* 快速选择(带常用选项)
(
message: string,
options: string[],
defaultIndex: number = 0
)
| 252 | * 快速选择(带常用选项) |
| 253 | */ |
| 254 | public static async quickSelect( |
| 255 | message: string, |
| 256 | options: string[], |
| 257 | defaultIndex: number = 0 |
| 258 | ): Promise<string> { |
| 259 | const choices: Choice[] = options.map(option => ({ |
| 260 | name: option, |
| 261 | value: option, |
| 262 | short: option, |
| 263 | })); |
| 264 | |
| 265 | return this.select(message, choices, { |
| 266 | default: options[defaultIndex], |
| 267 | }); |
| 268 | } |
| 269 | } |