minor fix
parent
b931e6b7fd
commit
0f62958024
|
@ -200,22 +200,9 @@ def execute_blackjack(v, target, body, type):
|
||||||
send_repeatable_notification(id, f"Blackjack by @{v.username}: {extra_info}")
|
send_repeatable_notification(id, f"Blackjack by @{v.username}: {extra_info}")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def execute_anti_grooming(v, c, u):
|
def notify_jannies_of_grooming(v, c, u):
|
||||||
if 'discord' not in c.body and 'groomercord' not in c.body or v.shadowbanned:
|
if 'discord' not in c.body and 'groomercord' not in c.body:
|
||||||
return
|
return
|
||||||
|
|
||||||
v.shadowbanned = AUTOJANNY_ID
|
|
||||||
|
|
||||||
ma = ModAction(
|
|
||||||
kind="shadowban",
|
|
||||||
user_id=AUTOJANNY_ID,
|
|
||||||
target_user_id=v.id,
|
|
||||||
_note=f'reason: "Grooming @{u.username}"'
|
|
||||||
)
|
|
||||||
g.db.add(ma)
|
|
||||||
|
|
||||||
v.ban_reason = f"Grooming @{u.username}"
|
|
||||||
g.db.add(v)
|
|
||||||
|
|
||||||
notified_ids = [x[0] for x in g.db.query(User.id).filter(User.admin_level >= PERMS['BLACKJACK_NOTIFICATIONS'])]
|
notified_ids = [x[0] for x in g.db.query(User.id).filter(User.admin_level >= PERMS['BLACKJACK_NOTIFICATIONS'])]
|
||||||
|
|
||||||
|
|
|
@ -536,7 +536,7 @@ def message2(v:User, username:str):
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
execute_blackjack(v, c, c.body_html, 'message')
|
execute_blackjack(v, c, c.body_html, 'message')
|
||||||
execute_under_siege(v, c, c.body_html, 'message')
|
execute_under_siege(v, c, c.body_html, 'message')
|
||||||
execute_anti_grooming(v, c, user)
|
notify_jannies_of_grooming(v, c, user)
|
||||||
c.top_comment_id = c.id
|
c.top_comment_id = c.id
|
||||||
|
|
||||||
if user.id not in bots:
|
if user.id not in bots:
|
||||||
|
@ -610,7 +610,7 @@ def messagereply(v:User):
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
execute_blackjack(v, c, c.body_html, 'message')
|
execute_blackjack(v, c, c.body_html, 'message')
|
||||||
execute_under_siege(v, c, c.body_html, 'message')
|
execute_under_siege(v, c, c.body_html, 'message')
|
||||||
execute_anti_grooming(v, c, user)
|
notify_jannies_of_grooming(v, c, user)
|
||||||
|
|
||||||
if user_id and user_id not in {v.id, MODMAIL_ID} | bots:
|
if user_id and user_id not in {v.id, MODMAIL_ID} | bots:
|
||||||
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=user_id).one_or_none()
|
notif = g.db.query(Notification).filter_by(comment_id=c.id, user_id=user_id).one_or_none()
|
||||||
|
|
Loading…
Reference in New Issue