overwrite ban reason

pull/80/head
Aevann1 2022-12-18 16:23:59 +02:00
parent ed5bbc43fa
commit cafe3c47d3
2 changed files with 5 additions and 4 deletions

View File

@ -386,7 +386,7 @@ def execute_blackjack(v, target, body, type):
if not blackjack or not body: return True
if any(i in body.lower() for i in blackjack.split()):
v.shadowbanned = AUTOJANNY_ID
if not v.is_banned: v.ban_reason = f"Blackjack"
v.ban_reason = f"Blackjack"
g.db.add(v)
notif = None
extra_info = "unknown entity"
@ -469,7 +469,8 @@ def execute_under_siege(v:User, target:Optional[Union[Submission, Comment]], bod
if not get_setting("under_siege"): return True
if v.age < UNDER_SIEGE_AGE_THRESHOLD and not v.admin_level >= PERMS['SITE_BYPASS_UNDER_SIEGE_MODE']:
v.shadowbanned = AUTOJANNY_ID
if not v.is_banned: v.ban_reason = f"Under Siege"
v.ban_reason = f"Under Siege"
v.is_muted = True
g.db.add(v)
t = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(time.time()))

View File

@ -72,11 +72,11 @@ def check_for_alts(current:User, include_current_session=True):
if u._alt_deleted: continue
if u.shadowbanned:
current.shadowbanned = u.shadowbanned
if not current.is_banned: current.ban_reason = u.ban_reason
current.ban_reason = u.ban_reason
g.db.add(current)
elif current.shadowbanned:
u.shadowbanned = current.shadowbanned
if not u.is_banned: u.ban_reason = current.ban_reason
u.ban_reason = current.ban_reason
g.db.add(u)
def execute_shadowban_viewers_and_voters(v:Optional[User], target:Union[Submission, Comment]):