forked from MarseyWorld/MarseyWorld
fix 500 error
parent
2c14d23e7b
commit
e17904e938
|
@ -73,18 +73,19 @@ def execute_blackjack(v, target, body, kind):
|
|||
|
||||
if not execute: return False
|
||||
|
||||
v.shadowbanned = AUTOJANNY_ID
|
||||
if v:
|
||||
v.shadowbanned = AUTOJANNY_ID
|
||||
|
||||
ma = ModAction(
|
||||
kind="shadowban",
|
||||
user_id=AUTOJANNY_ID,
|
||||
target_user_id=v.id,
|
||||
_note=f'reason: "Blackjack: {kind}"'
|
||||
)
|
||||
g.db.add(ma)
|
||||
ma = ModAction(
|
||||
kind="shadowban",
|
||||
user_id=AUTOJANNY_ID,
|
||||
target_user_id=v.id,
|
||||
_note=f'reason: "Blackjack: {kind}"'
|
||||
)
|
||||
g.db.add(ma)
|
||||
|
||||
v.shadowban_reason = f"Blackjack: {kind}"
|
||||
g.db.add(v)
|
||||
v.shadowban_reason = f"Blackjack: {kind}"
|
||||
g.db.add(v)
|
||||
|
||||
notified_ids = [x[0] for x in g.db.query(User.id).filter(User.admin_level >= PERMS['BLACKJACK_NOTIFICATIONS'])]
|
||||
extra_info = kind
|
||||
|
@ -105,7 +106,8 @@ def execute_blackjack(v, target, body, kind):
|
|||
|
||||
if extra_info:
|
||||
for id in notified_ids:
|
||||
send_repeatable_notification_duplicated(id, f"Blackjack by @{v.username}: {extra_info}")
|
||||
username = v.username if v else 'AutoJanny'
|
||||
send_repeatable_notification_duplicated(id, f"Blackjack by @{username}: {extra_info}")
|
||||
return True
|
||||
|
||||
def find_all_emoji_endings(emoji):
|
||||
|
|
Loading…
Reference in New Issue