forked from rDrama/rDrama
1
0
Fork 0
master
Aevann 2022-12-27 04:07:38 +02:00
parent f4164052cf
commit 7b8483b83f
1 changed files with 19 additions and 18 deletions

View File

@ -379,26 +379,27 @@ def execute_blackjack(v, target, body, type):
elif hasattr(target, 'is_banned'):
target.is_banned = True
extra_info = "unknown entity"
if CARP_ID and AEVANN_ID:
extra_info = "unknown entity"
if type == 'submission':
extra_info = target.permalink
elif type == 'chat':
extra_info = "chat message"
elif type == 'flag':
extra_info = f"reports on {target.permalink}"
elif type == 'modmail':
extra_info = "modmail"
elif type in {'comment', 'message'}:
for id in (CARP_ID, AEVANN_ID):
n = Notification(comment_id=target.id, user_id=id)
g.db.add(n)
g.db.flush()
extra_info = None
if type == 'submission':
extra_info = target.permalink
elif type == 'chat':
extra_info = "chat message"
elif type == 'flag':
extra_info = f"reports on {target.permalink}"
elif type == 'modmail':
extra_info = "modmail"
elif type in {'comment', 'message'}:
for id in (CARP_ID, AEVANN_ID):
n = Notification(comment_id=target.id, user_id=id)
g.db.add(n)
g.db.flush()
extra_info = None
if extra_info:
for id in (CARP_ID, AEVANN_ID):
send_repeatable_notification(id, f"Blackjack for @{v.username}: {extra_info}")
if extra_info:
for id in (CARP_ID, AEVANN_ID):
send_repeatable_notification(id, f"Blackjack for @{v.username}: {extra_info}")
return False
return True