diff --git a/handlers/messages_routing.py b/handlers/messages_routing.py index f588efa..a93c4a9 100644 --- a/handlers/messages_routing.py +++ b/handlers/messages_routing.py @@ -70,7 +70,8 @@ async def messages_routing(msg, state): if toxic_score: emoji = ( - "😳" + "🤯" if toxic_score > 100 + else "😳" if toxic_score > 90 else "😟" if toxic_score > 80 @@ -116,7 +117,7 @@ async def messages_routing(msg, state): toxic_perc = math.floor(toxic_score * 100) if toxic_score < 0.9 and text != text.replace(' ', ''): logger.info('re-check without spaces') - toxic_perc += check_stopwords(normalized_text): + toxic_perc += check_stopwords(normalized_text) logger.info(f"text: {normalized_text}\ntoxic: {toxic_perc}%") await redis.set(f"toxic:{cid}", mid)