From cc4f8931be757ed69e9742d596dad5cfc62a012f Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Wed, 20 Jul 2022 16:16:34 +0800 Subject: [PATCH] :bug: fix bug --- utils/message_util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/message_util.py b/utils/message_util.py index 928daa9..2bbd883 100644 --- a/utils/message_util.py +++ b/utils/message_util.py @@ -157,13 +157,13 @@ async def get_at_target(msg): # message预处理,获取uid、干净的msg、user_id、是否缓存 -async def get_uid_in_msg(event: MessageEvent, msg: Message): - msg = msg.extract_plain_text().strip() +async def get_uid_in_msg(event: MessageEvent, msg: Union[Message, str]): + if isinstance(msg, Message): + msg = msg.extract_plain_text().strip() if not msg: uid = await get_last_query(str(event.user_id)) return uid, '', str(event.user_id), True user_id = await get_at_target(event.message) or str(event.user_id) - # msg = re.sub(r'\[CQ.*?\]', '', msg) use_cache = False if '-r' in msg else True msg = msg.replace('-r', '').strip() find_uid = r'(?P(1|2|5)\d{8})'