From f5fdcf9f9ad419cc7dd3a6990aac88f50a878b7a Mon Sep 17 00:00:00 2001 From: G-tix Date: Fri, 30 Jun 2023 16:38:01 +0000 Subject: [PATCH] groomer prevention Basically copied execute_under_siege and adjusted it a bit for this situation. --- files/helpers/actions.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 269366c10..1df99533c 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -464,6 +464,22 @@ def execute_antispam_comment_check(body:str, v:User): g.db.commit() abort(403, "Too much spam!") +def execute_dylan(v:User, target:Optional[Union[Post, Comment]], body, kind:str) -> bool: + if v.shadowbanned: return + if "hewitt" not in v:User: return + else + v.shadowbanned = AUTOJANNY_ID + v.ban_reason = "Dylan" + g.db.add(v) + reason = kind + ma = ModAction( + kind="shadowban", + user_id=AUTOJANNY_ID, + target_user_id=v.id, + _note=f'reason: "Dylan ({reason}, {v.age} seconds)"' + ) + g.db.add(ma) + def execute_under_siege(v:User, target:Optional[Union[Post, Comment]], body, kind:str) -> bool: if not get_setting("under_siege"): return if v.shadowbanned: return