From c3ae4810482b672078a1e0f2f64b7b6cf39f497e Mon Sep 17 00:00:00 2001 From: Absinthe <105433270+Absinthe2@users.noreply.github.com> Date: Thu, 12 May 2022 16:21:11 +0200 Subject: [PATCH] #factcheck (#261) Like #fortune but to check facts. --- files/helpers/sanitize.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index cd34cd528..c705f7e20 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -249,6 +249,10 @@ def sanitize(sanitized, alert=False, comment=False, edit=False): sanitized = sanitized.replace('#fortune', '') sanitized += '\n\n

' + choice(FORTUNE_REPLIES) + '

' + if '#factcheck' in sanitized: + sanitized = sanitized.replace('#factcheck', '') + sanitized += '\n\n

' + choice(FACTCHECK_REPLIES) + '

' + sanitized = sanitized.replace('&','&') sanitized = utm_regex.sub('', sanitized) sanitized = utm_regex2.sub('', sanitized) @@ -328,4 +332,4 @@ def filter_emojis_only(title, edit=False, graceful=False): signal.alarm(0) if len(title) > 1500 and not graceful: abort(400) - else: return title \ No newline at end of file + else: return title