From 15e0447826ddc75031face5226284ef1de348f53 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 1 Oct 2022 19:37:25 +0200 Subject: [PATCH] ban ppl for 14 minutes if snappy comments ":marseyban:" on their post --- files/helpers/actions.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/files/helpers/actions.py b/files/helpers/actions.py index 611532830..cb170e2ac 100644 --- a/files/helpers/actions.py +++ b/files/helpers/actions.py @@ -168,6 +168,23 @@ def execute_snappy(post, v): post.stickied = "Snappy" post.stickied_utc = int(time.time()) + 3600 + if SITE_NAME == 'rDrama' and body.startswith(':#marseyban:'): + days = 0.01 + reason = f'/post/{post.id}' + v.ban(admin=snappy, reason=reason, days=days) + text = f"@Snappy has banned you for **{days}** days for the following reason:\n\n> {reason}" + send_repeatable_notification(v.id, text) + duration = f"for {days} days" + note = f'reason: "{reason}", duration: {duration}' + ma=ModAction( + kind="ban_user", + user_id=snappy.id, + target_user_id=v.id, + _note=note + ) + g.db.add(ma) + post.bannedfor = f'{duration} by @Snappy' + g.db.flush() c.top_comment_id = c.id