better ban award code

master
Aevann 2024-10-21 23:31:51 +03:00
parent 8d45cf9267
commit 7a28fc54ed
1 changed files with 3 additions and 4 deletions

View File

@ -362,10 +362,9 @@ def award_thing(v, thing_type, id):
if not emoji:
stop(404, f'an Emoji with the name "{award.note}" was not found!')
elif kind == "ban":
if not author.is_suspended:
author.ban(reason=ban_reason, days=quantity, modlog=False)
elif author.unban_utc:
author.unban_utc += 86400 * quantity
if author.is_permabanned:
stop(400, f"{safe_username} already permabanned!")
author.ban(reason=ban_reason, days=quantity, modlog=False)
send_repeatable_notification(author.id, f"Your account has been banned for **{quantity} day{s}** for {obj.textlink}. It sucked and you should feel bad.")
elif kind == "unban":
if not author.is_suspended or not author.unban_utc: