Skip to content

Commit

Permalink
Fix command parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyparrish committed Feb 21, 2024
1 parent d08be02 commit ad826e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/commands/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ function parse_command() {

local INDEX
for (( INDEX=0; INDEX < ${#TOKENS[@]}; INDEX++ )); do
if [[ "${TOKENS[i]}" == "/bot" ]]; then
BOT_COMMAND="${TOKENS[i+1]}"
# A slice of all tokens starting with index i+2.
BOT_ARGUMENTS=( "${TOKENS[@]:i+2}" )
if [[ "${TOKENS[INDEX]}" == "/bot" ]]; then
BOT_COMMAND="${TOKENS[INDEX+1]}"
# A slice of all tokens starting with INDEX+2.
BOT_ARGUMENTS=( "${TOKENS[@]:INDEX+2}" )
return 0
fi
done
Expand Down

0 comments on commit ad826e9

Please # to comment.