mirror of
https://github.com/maubot/maubot.git
synced 2024-10-01 01:06:10 -04:00
Fix bug with default __mb_is_command_match__ impl when using lambda command names
This commit is contained in:
parent
b1e9c8cf16
commit
7b4d3e8313
@ -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 New Issue
Block a user