增加新的接收信息装饰器, 并支持自定义函数接受信息类型, 增加防撤回

This commit is contained in:
Mr.yang
2023-10-08 22:41:25 +08:00
parent f321ed6d85
commit 15a6264f0d
6 changed files with 12 additions and 8 deletions
-2
View File
@@ -144,8 +144,6 @@ class Register(Event):
raise NotImplementedError
def group_changed_register(self,
isGroup: bool = False,
isDivision: bool = False,
isPyq: bool = False,
allow_other_receive: bool = True):
"""
+7 -5
View File
@@ -79,7 +79,9 @@ def _processing_async_func(self,
return await func(bot, message)
except:
traceback.print_exc()
return __async_func
return _async_func
@@ -109,7 +111,9 @@ def _processing_universal_func(self,
return func(bot, message)
except:
traceback.print_exc()
return universal_func
return _universal_func
@@ -144,8 +148,6 @@ def revoke_message_register(self,
def group_changed_register(self,
isGroup: bool = False,
isDivision: bool = False,
isPyq: bool = False,
allow_other_receive: bool = True):
def judge_msg(msg):
@@ -154,9 +156,9 @@ def group_changed_register(self,
return True
return False
return self._processing_async_func(isGroup,
isDivision,
isPyq,
return self._processing_async_func(isPyq=isPyq,
isGroup=True,
isDivision=True,
register_name='groupChanged',
allow_other_receive=allow_other_receive,
judge_msg=judge_msg)