From c7d105591f57bc2966b4d731c7039069ff0294db Mon Sep 17 00:00:00 2001 From: hackrobot Date: Thu, 11 Apr 2024 11:08:12 +0800 Subject: [PATCH] ewfwef --- main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index b3ef71c..c0ad236 100644 --- a/main.py +++ b/main.py @@ -140,8 +140,10 @@ def h5group(nickname, db: Session = Depends(get_db)): pattern = r'收到(\w+)的在看' print(newtext) matches = re.findall(pattern, newtext) - matchesString=matches[0] - if matches: + matchesString=None + if len(matches)>0: + matchesString=matches[0] + if matchesString: print("匹配到的结果:", matchesString) # 判断是否在群中 inGroup = False