Fix bug with default __mb_is_command_match__ impl when using lambda command names
This commit is contained in:
parent
b1e9c8cf16
commit
7b4d3e8313
1 changed files with 2 additions and 2 deletions
|
@ -229,10 +229,10 @@ def new(name: PrefixType = None, *, help: str = None, aliases: AliasesType = Non
|
|||
else:
|
||||
func.__mb_is_command_match__ = aliases
|
||||
elif isinstance(aliases, (list, set, tuple)):
|
||||
func.__mb_is_command_match__ = lambda self, val: (val == func.__mb_name__
|
||||
func.__mb_is_command_match__ = lambda self, val: (val == func.__mb_get_name__(self)
|
||||
or val in aliases)
|
||||
else:
|
||||
func.__mb_is_command_match__ = lambda self, val: val == func.__mb_name__
|
||||
func.__mb_is_command_match__ = lambda self, val: val == func.__mb_get_name__(self)
|
||||
# Decorators are executed last to first, so we reverse the argument list.
|
||||
func.__mb_arguments__.reverse()
|
||||
func.__mb_require_subcommand__ = require_subcommand
|
||||
|
|
Loading…
Reference in a new issue