From bf5eab5758fbfff59182356eecf28e5bf5a90b03 Mon Sep 17 00:00:00 2001 From: AlberLC Date: Sun, 12 Jun 2022 00:13:20 +0200 Subject: [PATCH] Fix _on_scraping with replied message --- multibot/bots/multi_bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multibot/bots/multi_bot.py b/multibot/bots/multi_bot.py index 67d56ab..9102b21 100644 --- a/multibot/bots/multi_bot.py +++ b/multibot/bots/multi_bot.py @@ -412,7 +412,7 @@ def _parse_callbacks( for keywords_group in registered_callback.keywords: text_words += [original_text_word for original_text_word in original_text_words if original_text_word in keywords_group] word_matches = flanautils.cartesian_product_string_matching(text_words, keywords_group, min_ratio=registered_callback.min_ratio) - ratio = sum((max(matches.values()) + 1) ** ratio_reward_exponent for text_word, matches in word_matches.items()) + ratio = sum((max(matches.values()) + 1) ** ratio_reward_exponent for matches in word_matches.values()) try: ratio /= max(1., keywords_lenght_penalty * len(keywords_group)) except ZeroDivisionError: