Skip to content

Commit

Permalink
Fix command args
Browse files Browse the repository at this point in the history
  • Loading branch information
mymmrac committed May 30, 2024
1 parent 7f34997 commit a52168e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions telegohandler/predicates.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func CommandEqualArgc(command string, argc int) Predicate {

return strings.EqualFold(matches[CommandMatchCmdGroup], command) &&
(argc == 0 && matches[CommandMatchArgsGroup] == "" ||
len(strings.Split(matches[CommandMatchArgsGroup], " ")) == argc)
len(strings.Fields(matches[CommandMatchArgsGroup])) == argc)
}
}

Expand Down Expand Up @@ -695,7 +695,7 @@ func CaptionCommandEqualArgc(command string, argc int) Predicate {

return strings.EqualFold(matches[CommandMatchCmdGroup], command) &&
(argc == 0 && matches[CommandMatchArgsGroup] == "" ||
len(strings.Split(matches[CommandMatchArgsGroup], " ")) == argc)
len(strings.Fields(matches[CommandMatchArgsGroup])) == argc)
}
}

Expand Down

0 comments on commit a52168e

Please sign in to comment.