From 7b4d3e8313e75521efc4a7744f07e298c20f397b Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 20 Jun 2019 16:55:55 +0300 Subject: [PATCH] Fix bug with default __mb_is_command_match__ impl when using lambda command names --- maubot/handlers/command.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maubot/handlers/command.py b/maubot/handlers/command.py index 800dd52..165c366 100644 --- a/maubot/handlers/command.py +++ b/maubot/handlers/command.py @@ -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