From 70cff5f756a0c1c9f55d10affb196f051f4551f2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 19 Dec 2024 23:45:35 +0300 Subject: [PATCH] invisible labs should works... yes, again --- src/autobioebbing.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/autobioebbing.py b/src/autobioebbing.py index b28cccc..200c5bd 100644 --- a/src/autobioebbing.py +++ b/src/autobioebbing.py @@ -90,11 +90,14 @@ def find_infect_theme(text): trying_theme_index = bio_attack_themes.index(theme) logger.debug(f'trying theme {trying_theme_index}...') r, bioexp, days, remaining = re.findall(theme[0], text), re.findall(theme[1], text), re.findall(theme[2], text), re.findall(theme[3], text) - if len(r) > 2 and bioexp and days and remaining: + if r and bioexp and days and remaining: logger.debug(f'found theme {trying_theme_index}') return r, bio_attack_themes[trying_theme_index] - r = re.findall(theme[0].split('', 1)[1], text) - if len(r) == 1 and bioexp and days and remaining: + for theme in bio_attack_themes: + trying_theme_index = bio_attack_themes.index(theme) + logger.debug(f'trying theme {trying_theme_index} [without first lab]...') + r, bioexp, days, remaining = re.findall(theme[0].split('', 1)[1], text), re.findall(theme[1], text), re.findall(theme[2], text), re.findall(theme[3], text) + if r and bioexp and days and remaining: logger.debug(f'found theme {trying_theme_index}, but invisible first lab it will be replaced to avocado id') r = [(f'tg://openmessage?user_id={avocado_id}', r[0])] return r, bio_attack_themes[trying_theme_index]