将消息判断前置
This commit is contained in:
@@ -58,6 +58,9 @@ class GroupMemberChangePlugin(MessagePluginInterface):
|
|||||||
|
|
||||||
def can_process(self, message: Dict[str, Any]) -> bool:
|
def can_process(self, message: Dict[str, Any]) -> bool:
|
||||||
"""检查是否可以处理该消息"""
|
"""检查是否可以处理该消息"""
|
||||||
|
content = message.get("content")
|
||||||
|
if not content or "<sysmsg" not in content:
|
||||||
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
async def process_message(self, message: Dict[str, Any]) -> Tuple[bool, Optional[str]]:
|
async def process_message(self, message: Dict[str, Any]) -> Tuple[bool, Optional[str]]:
|
||||||
@@ -67,8 +70,6 @@ class GroupMemberChangePlugin(MessagePluginInterface):
|
|||||||
content = content.clean_content
|
content = content.clean_content
|
||||||
content = str(content).strip()
|
content = str(content).strip()
|
||||||
self.LOG.debug(f"插件执行: {self.name}:{content}")
|
self.LOG.debug(f"插件执行: {self.name}:{content}")
|
||||||
if not content or "<sysmsg" not in content:
|
|
||||||
return False, "非系统消息"
|
|
||||||
sender = message.get("sender")
|
sender = message.get("sender")
|
||||||
roomid = message.get("roomid", "")
|
roomid = message.get("roomid", "")
|
||||||
gbm: GroupBotManager = message.get("gbm")
|
gbm: GroupBotManager = message.get("gbm")
|
||||||
|
|||||||
Reference in New Issue
Block a user