forked from rDrama/rDrama
like last commit but better
parent
4a6cd663cd
commit
fcac9b50be
|
@ -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} '
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue