🐛 fix bug

This commit is contained in:
CMHopeSunshine 2022-07-20 16:16:34 +08:00
parent 943b6de2db
commit cc4f8931be

View File

@ -157,13 +157,13 @@ async def get_at_target(msg):
# message预处理获取uid、干净的msg、user_id、是否缓存 # message预处理获取uid、干净的msg、user_id、是否缓存
async def get_uid_in_msg(event: MessageEvent, msg: Message): async def get_uid_in_msg(event: MessageEvent, msg: Union[Message, str]):
msg = msg.extract_plain_text().strip() if isinstance(msg, Message):
msg = msg.extract_plain_text().strip()
if not msg: if not msg:
uid = await get_last_query(str(event.user_id)) uid = await get_last_query(str(event.user_id))
return uid, '', str(event.user_id), True return uid, '', str(event.user_id), True
user_id = await get_at_target(event.message) or str(event.user_id) 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 use_cache = False if '-r' in msg else True
msg = msg.replace('-r', '').strip() msg = msg.replace('-r', '').strip()
find_uid = r'(?P<uid>(1|2|5)\d{8})' find_uid = r'(?P<uid>(1|2|5)\d{8})'