修复at导致指令无法识别的问题

This commit is contained in:
2025-11-10 09:55:43 +08:00
parent 22444a2394
commit d408de29af
2 changed files with 4 additions and 11 deletions

2
PWF

Submodule PWF updated: 7deef9092a...36324398c3

View File

@@ -159,18 +159,11 @@ class BasicWPSInterface(PluginInterface):
return self.get_message_sender(webhook_url).send_link
else:
raise ValueError(f"Invalid message sender type: {type}")
# 机器人名称模式(用于从@消息中提取)
AT_PATTERN = re.compile(r'@[^\s]+\s+(.+)', re.DOTALL)
def parse_message_after_at(self, message: str) -> str:
# 去除首尾空格
message = message.strip()
# 尝试提取@后的内容
at_match = BasicWPSInterface.AT_PATTERN.search(message)
if at_match:
return at_match.group(1).strip()
'''
已过时
'''
return message
async def send_markdown_message(self, message: str, chat_id: int, user_id: int) -> str|None: