diff --git a/other_ext/kamaz_ai.py b/other_ext/kamaz_ai.py index e0e048a..25f1be4 100644 --- a/other_ext/kamaz_ai.py +++ b/other_ext/kamaz_ai.py @@ -107,16 +107,24 @@ class KamazAI: score += self.WEIGHTS['steam_identity'] * identity_score # 2. Причина (точное совпадение) - reason_score = 1.0 if report1['reasons'] == report2['reasons'] else 0.0 - score += self.WEIGHTS['reason'] * reason_score + try: + reason_score = 1.0 if report1['reasons'] == report2['reasons'] else 0.0 + score += self.WEIGHTS['reason'] * reason_score + except: + print("Skip reason calc", report1, report2) + traceback.print_exc() # 3. Права - perm_score = 0.0 - if report1['a_permition'] == report2['a_permition']: - perm_score += 0.5 - if report1['r_permition'] == report2['r_permition']: - perm_score += 0.5 - score += self.WEIGHTS['permissions'] * perm_score + try: + perm_score = 0.0 + if report1['a_permition'] == report2['a_permition']: + perm_score += 0.5 + if report1['r_permition'] == report2['r_permition']: + perm_score += 0.5 + score += self.WEIGHTS['permissions'] * perm_score + except: + print("Skip permition calc", report1, report2) + traceback.print_exc() # 4. Числовые поля (нормированное евклидово расстояние -> сходство) num_fields = ['a_kills', 'a_deads', 'a_seconds', 'r_kills', 'r_deads', 'r_seconds', 'online'] @@ -223,6 +231,7 @@ class Extension: try: report_id = message.embeds[0].color.value + #print("Found report id", report_id) except: return await message.reply(content=f'KamazAI не может получить индификатор репорта') diff --git a/other_ext/webhook_helper.py b/other_ext/webhook_helper.py index c380fcd..628d2f4 100644 --- a/other_ext/webhook_helper.py +++ b/other_ext/webhook_helper.py @@ -32,6 +32,7 @@ class Extension: "<:hueglot:713139400028061767>":("kick", {"profile":"", "requester_profile":"", "discord_user":None, "reason":""}), "🔍":("profile", {"profile":"", "discord_user":None}), "🔎":("profile", {"profile":"", "requester_profile":"", "discord_user":None}) + #"<:baldej:713142151520976957>": ("kamaz_ai", {}) } self.reaction_translate = { @@ -45,6 +46,7 @@ class Extension: '🔇':"mute", '😇':"unban", '🔎':'author_inspect' + #'<:baldej:713142151520976957>': 'kamaz_ai' } @core.listen()