From 1854b38d32041da9bdd04bb092805eda1c46eba7 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 20 Aug 2023 04:06:52 +0300 Subject: [PATCH] why didnt top try this lol --- files/helpers/sanitize.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 4e052f048..ab876b5f9 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -217,46 +217,48 @@ def execute_blackjack(v, target, body, kind): return True def find_all_emote_endings(word): - endings = list() - curr_word = word + endings = [] + + if path.isfile(f'files/assets/images/emojis/{word}.webp'): + return endings, word is_non_ending_found = False while not is_non_ending_found: - if curr_word.endswith('pat'): + if word.endswith('pat'): if 'pat' in endings: is_non_ending_found = True continue endings.append('pat') - curr_word = curr_word[:-3] + word = word[:-3] continue - if curr_word.endswith('talking'): + if word.endswith('talking'): if 'talking' in endings: is_non_ending_found = True continue endings.append('talking') - curr_word = curr_word[:-7] + word = word[:-7] continue - if curr_word.endswith('genocide'): + if word.endswith('genocide'): if 'genocide' in endings: is_non_ending_found = True continue endings.append('genocide') - curr_word = curr_word[:-8] + word = word[:-8] continue - if curr_word.endswith('love'): + if word.endswith('love'): if 'love' in endings: is_non_ending_found = True continue endings.append('love') - curr_word = curr_word[:-4] + word = word[:-4] continue is_non_ending_found = True - return endings, curr_word + return endings, word def render_emoji(html, regexp, golden, emojis_used, b=False, is_title=False):