forked from rDrama/rDrama
1
0
Fork 0

like last commit but better

master
Aevann 2023-10-13 21:49:21 +03:00
parent 4a6cd663cd
commit fcac9b50be
2 changed files with 5 additions and 8 deletions

View File

@ -1,17 +1,14 @@
from random import choice
from .const_stateful import MARSEY_MAPPINGS
from .config.const import *
chud_words = set()
for phrase in CHUD_PHRASES:
chud_words.update(phrase.lower().split())
def marsify(text):
def marsify(text, chud_phrase):
if '`' in text or '<pre>' in text or '<code>' in text:
return text
chud_words = chud_phrase.split() if chud_phrase else []
new_text = ''
for x in text.split(' '):
new_text += f'{x} '

View File

@ -380,7 +380,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
if author.owoify:
sanitized = owoify(sanitized)
if author.marsify:
sanitized = marsify(sanitized)
sanitized = marsify(sanitized, author.chud_phrase)
if obj and obj.sharpened:
sanitized = sharpen(sanitized)
@ -680,7 +680,7 @@ def filter_emojis_only(title, golden=True, count_emojis=False, obj=None, author=
if author.owoify:
title = owoify(title)
if author.marsify:
title = marsify(title)
title = marsify(title, author.chud_phrase)
if obj and obj.sharpened:
title = sharpen(title)