mirror of
https://github.com/maubot/maubot.git
synced 2024-10-01 01:06:10 -04:00
Fix getting name of function for command handlers
This commit is contained in:
parent
e26a2abf58
commit
92a14f20f6
@ -235,7 +235,7 @@ def new(name: PrefixType = None, *, help: str = None, aliases: AliasesType = Non
|
|||||||
else:
|
else:
|
||||||
func.__mb_get_name__ = lambda self: name
|
func.__mb_get_name__ = lambda self: name
|
||||||
else:
|
else:
|
||||||
func.__mb_get_name__ = lambda self: func.__name__
|
func.__mb_get_name__ = lambda self: func.__mb_func__.__name__
|
||||||
if callable(aliases):
|
if callable(aliases):
|
||||||
if len(inspect.getfullargspec(aliases).args) == 1:
|
if len(inspect.getfullargspec(aliases).args) == 1:
|
||||||
func.__mb_is_command_match__ = lambda self, val: aliases(val)
|
func.__mb_is_command_match__ = lambda self, val: aliases(val)
|
||||||
|
Loading…
Reference in New Issue
Block a user