add missing start/end named arg index to /:

This commit is contained in:
LenAnderson 2024-07-27 12:50:30 -04:00
parent a6443f71a3
commit cf42c4044e
1 changed files with 2 additions and 0 deletions

View File

@ -922,11 +922,13 @@ export class SlashCommandParser {
else assignment.value = this.parseValue(); else assignment.value = this.parseValue();
cmd.unnamedArgumentList = [assignment]; cmd.unnamedArgumentList = [assignment];
this.discardWhitespace(); this.discardWhitespace();
cmd.startNamedArgs = this.index;
while (this.testNamedArgument()) { while (this.testNamedArgument()) {
const arg = this.parseNamedArgument(); const arg = this.parseNamedArgument();
cmd.namedArgumentList.push(arg); cmd.namedArgumentList.push(arg);
this.discardWhitespace(); this.discardWhitespace();
} }
cmd.endNamedArgs = this.index;
this.discardWhitespace(); this.discardWhitespace();
// /run shorthand does not take unnamed arguments (the command name practically *is* the unnamed argument) // /run shorthand does not take unnamed arguments (the command name practically *is* the unnamed argument)
if (this.testRunShorthandEnd()) { if (this.testRunShorthandEnd()) {