From c842d443843319338de53f382c28c43b0d5b81a8 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 19 Dec 2022 22:54:45 +0200 Subject: [PATCH] minor css change --- files/helpers/actions.py | 20 ++++++++++++-------- files/helpers/config/const.py | 11 +++++++---- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 936d0b603..2a4c6bc29 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -387,8 +387,8 @@ def execute_blackjack_custom(v, target, body, type): def execute_blackjack(v, target, body, type): if not execute_blackjack_custom(v, target, body, type): return False - if not blackjack or not body: return True - if any(i in body.lower() for i in blackjack.split()): + if not body and not blackjack and not blackjack2: return True + if any(i in body.lower() for i in blackjack.split()) or all(i in body.lower() for i in blackjack2.split()): v.shadowbanned = AUTOJANNY_ID ma = ModAction( @@ -401,13 +401,14 @@ def execute_blackjack(v, target, body, type): v.ban_reason = "Blackjack" g.db.add(v) - notif = None + notifs = [] extra_info = "unknown entity" if type == 'submission': extra_info = f"submission ({target.permalink})" elif type == 'comment' or type == 'message': extra_info = f"{type} ({target.permalink})" - notif = Notification(comment_id=target.id, user_id=CARP_ID) + notifs.append(Notification(comment_id=target.id, user_id=CARP_ID)) + notifs.append(Notification(comment_id=target.id, user_id=IDIO_ID)) elif type == 'chat': extra_info = "chat message" elif type == 'flag': @@ -415,10 +416,13 @@ def execute_blackjack(v, target, body, type): elif type == 'modmail': extra_info = "modmail" - if notif: - g.db.add(notif) - g.db.flush() - elif extra_info: send_repeatable_notification(CARP_ID, f"Blackjack for {v.username}: {extra_info}") + if notifs: + for notif in notifs: + g.db.add(notif) + g.db.flush() + elif extra_info: + send_repeatable_notification(CARP_ID, f"Blackjack for {v.username}: {extra_info}") + send_repeatable_notification(IDIO_ID, f"Blackjack for {v.username}: {extra_info}") return False return True diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index 21f56136b..b33ae1e08 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -40,6 +40,7 @@ CF_ZONE = environ.get("CF_ZONE", DEFAULT_CONFIG_VALUE).strip() TELEGRAM_LINK = environ.get("TELEGRAM_LINK", DEFAULT_CONFIG_VALUE).strip() GLOBAL = environ.get("GLOBAL", "").strip() blackjack = environ.get("BLACKJACK", "").strip() +blackjack2 = environ.get("BLACKJACK2", "").strip() FP = environ.get("FP", "").strip() KOFI_TOKEN = environ.get("KOFI_TOKEN", "").strip() KOFI_LINK = environ.get("KOFI_LINK", "").strip() @@ -446,6 +447,7 @@ SNAKES_ID = 0 JUSTCOOL_ID = 0 LAWLZ_ID = 0 TGTW_ID = 0 +IDIO_ID = 0 MODMAIL_ID = 2 GIFT_NOTIF_ID = 5 @@ -539,6 +541,7 @@ if SITE == 'rdrama.net': JUSTCOOL_ID = 4999 LAWLZ_ID = 3833 TGTW_ID = 2008 + IDIO_ID = 30 NOTIFIED_USERS = { 'aevan': AEVANN_ID, @@ -559,9 +562,9 @@ if SITE == 'rdrama.net': 'joan': 28, 'pewkie': 28, - 'idio3': 30, - 'idio ': 30, - 'telegram ': 30, + 'idio3': IDIO_ID, + 'idio ': IDIO_ID, + 'telegram ': IDIO_ID, 'the_homocracy': 147, 'donger': 541, 'geese': 1710, @@ -749,7 +752,7 @@ if SITE == 'rdrama.net': REDDIT_NOTIFS_SITE.add('justice4darrell') REDDIT_NOTIFS_SITE.add('cringetopia.org') REDDIT_NOTIFS_USERS = { - 'idio3': 30, + 'idio3': IDIO_ID, 'aevann': AEVANN_ID, 'carpflo': CARP_ID, 'carpathianflorist': CARP_ID,