修复at导致指令无法识别的问题
This commit is contained in:
2
PWF
2
PWF
Submodule PWF updated: 7deef9092a...36324398c3
@@ -159,18 +159,11 @@ class BasicWPSInterface(PluginInterface):
|
|||||||
return self.get_message_sender(webhook_url).send_link
|
return self.get_message_sender(webhook_url).send_link
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Invalid message sender type: {type}")
|
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:
|
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
|
return message
|
||||||
|
|
||||||
async def send_markdown_message(self, message: str, chat_id: int, user_id: int) -> str|None:
|
async def send_markdown_message(self, message: str, chat_id: int, user_id: int) -> str|None:
|
||||||
|
|||||||
Reference in New Issue
Block a user