forked from rDrama/rDrama
make marsify case-insensitive
parent
78e1b1d369
commit
e50fd2d0f4
|
@ -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:
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue