reduce slur filter down to necessary ones and partially implement what fish wants (closes #432)

signed off by snekfriend
remotes/1693176582716663532/tmp_refs/heads/watchparty
justcool393 2022-11-09 00:05:42 -06:00
parent e672330614
commit ffd9c73566
2 changed files with 4 additions and 1 deletions

View File

@ -140,7 +140,8 @@ if SITE_NAME == 'rDrama':
PROFANITIES = {
'motherfucker': 'motherlover',
'fuck': 'frick',
'fuck': ['frick', 'fudge', 'freak'],
' ass ': [' butt ', ' backside ', ' bum '],
'shitting': 'pooping',
'lmao': 'lmbo',
'damn': 'darn',

View File

@ -123,6 +123,8 @@ def sub_matcher(match:re.Match, upper=False, replace_with:Union[dict[str, str],
return match_str
else:
repl = replace_with[match_str.lower()]
if not isinstance(repl, str):
repl = random.choice(repl)
return repl if not upper or "<img" in repl else repl.upper()
def sub_matcher_upper(match, replace_with:Union[dict[str, str], dict[str, List[str]]]=SLURS):