From e50fd2d0f4c81672f6f023c130854273d55b910e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 2 Sep 2022 00:38:33 +0200 Subject: [PATCH] make marsify case-insensitive --- files/helpers/const.py | 2 +- files/helpers/marsify.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 40462d5a4..040be603d 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -918,7 +918,7 @@ marseys_const2 = marseys_const + ['chudsey','a','b','c','d','e','f','g','h','i', marseys = db.query(Marsey).all() marsey_mappings = {} for marsey in marseys: - for tag in marsey.tags.split(): + for tag in marsey.tags.lower().split(): if tag in marsey_mappings: marsey_mappings[tag].append(marsey.name) else: diff --git a/files/helpers/marsify.py b/files/helpers/marsify.py index 67aef9d19..f6876c234 100644 --- a/files/helpers/marsify.py +++ b/files/helpers/marsify.py @@ -5,7 +5,8 @@ def marsify(text): new_text = '' for x in text.split(' '): new_text += f'{x} ' - if 3 < len(x) < 10 and x in marsey_mappings: + x = x.lower() + if len(x) > 4 and x in marsey_mappings: marsey = choice(marsey_mappings[x]) new_text += f':{marsey}: ' return new_text \ No newline at end of file