seed marsifying

master
Aevann 2024-04-05 11:23:04 +02:00
parent 45133b6dd1
commit bfb562561b
2 changed files with 5 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import random
from .const_stateful import MARSEY_MAPPINGS
def marsify(text, chud_phrase):
def marsify(text, chud_phrase, seed):
if '`' in text or '<pre>' in text or '<code>' in text:
return text
@ -15,6 +15,8 @@ def marsify(text, chud_phrase):
x = x.lower()
if x in chud_words: continue
if len(x) >= 5 and x in MARSEY_MAPPINGS:
random.seed(seed)
marsey = random.choice(MARSEY_MAPPINGS[x])
random.seed()
new_text += f':{marsey}: '
return new_text

View File

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