fix(commands/utils): fix partial exact matching
play & playing
This commit is contained in:
parent
6930f964c5
commit
116ed896ab
@ -25,6 +25,14 @@ def match_token(token: str) -> list[Command]:
|
|||||||
if token.lower() == "r":
|
if token.lower() == "r":
|
||||||
return [Command.RELOAD]
|
return [Command.RELOAD]
|
||||||
|
|
||||||
|
if exact_match := list(
|
||||||
|
filter(
|
||||||
|
lambda command: command.value == token.lower(),
|
||||||
|
Command.__members__.values(),
|
||||||
|
)
|
||||||
|
):
|
||||||
|
return exact_match
|
||||||
|
|
||||||
return list(
|
return list(
|
||||||
filter(
|
filter(
|
||||||
lambda command: command.value.startswith(token.lower()),
|
lambda command: command.value.startswith(token.lower()),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user