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.
This commit is contained in:
parent
dedb96ec8d
commit
140aeb2bb7
|
@ -508,6 +508,14 @@ export class SlashCommandClosure {
|
||||||
return v;
|
return v;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
value ??= '';
|
||||||
|
|
||||||
|
// Make sure that if unnamed args are split, it should always return an array
|
||||||
|
if (executor.command.splitUnnamedArgument && !Array.isArray(value)) {
|
||||||
|
value = [value];
|
||||||
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue