Fix piping not using array for empty unnamed args - Lenny said if `splitUnnamedArgument` is enabled, the callback should always receive an array. - It is intended that if no value was provided, it'll get an array with an empty string. Because.. if no argument was provided for a non-split arg, it'll receive an empty string too.
| @@ -508,6 +508,14 @@ export class SlashCommandClosure { | |||
| 508 | return v; | 508 | return v; |
| 509 | }); | 509 | }); |
| 510 | } | 510 | } |
| 511 | |||
| 512 | value ??= ''; | ||
| 513 | |||
| 514 | // Make sure that if unnamed args are split, it should always return an array | ||
| 515 | if (executor.command.splitUnnamedArgument && !Array.isArray(value)) { | ||
| 516 | value = [value]; | ||
| 517 | } | ||
| 518 | |||
| 511 | return value; | 519 | return value; |
| 512 | } | 520 | } |
| 513 | 521 | ||