forked from rDrama/rDrama
1
0
Fork 0

make marsify case-insensitive

master
Aevann1 2022-09-02 00:38:33 +02:00
parent 78e1b1d369
commit e50fd2d0f4
2 changed files with 3 additions and 2 deletions

View File

@ -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:

View File

@ -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