修改赠与@信息

This commit is contained in:
liuwei
2025-11-28 09:40:01 +08:00
parent ee99254001
commit 6273b7bdba

View File

@@ -1767,11 +1767,11 @@ class XiuxianPlugin(MessagePluginInterface):
at_el = root.find('.//atuserlist')
text = (at_el.text if at_el is not None else '').strip()
text = text.strip(',')
text = re.sub(r'[\\s\\u3000]+', '', text)
text = re.sub(r'\s+', '', text)
at_set = set(text.split(','))
at_set.discard('')
if len(at_set) != 1:
await self._send_text_with_status(bot, sender, roomid, "请@一个明确的目标进行赠", 90)
await self._send_text_with_status(bot, sender, roomid, "请@一个明确的目标进行赠", 90)
return False, "目标无效"
target_wxid = next(iter(at_set))
tokens = [t for t in content.strip().split() if not t.startswith('@')]