remove empty first string and last string from unsplit list-parsed unnamed argument
This commit is contained in:
parent
adc54e7f22
commit
1fc34bd387
|
@ -946,10 +946,16 @@ export class SlashCommandParser {
|
|||
const firstVal = listValues[0];
|
||||
if (typeof firstVal.value == 'string') {
|
||||
firstVal.value = firstVal.value.trimStart();
|
||||
if (firstVal.value.length == 0) {
|
||||
listValues.shift();
|
||||
}
|
||||
}
|
||||
const lastVal = listValues.slice(-1)[0];
|
||||
if (typeof lastVal.value == 'string') {
|
||||
lastVal.value = lastVal.value.trimEnd();
|
||||
if (lastVal.value.length == 0) {
|
||||
listValues.pop();
|
||||
}
|
||||
}
|
||||
return listValues;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue