add vaporizing

master
Aevann1 2022-09-16 22:39:19 +02:00
parent 13e08f9561
commit 2c33b09bbc
1 changed files with 14 additions and 0 deletions

View File

@ -176,6 +176,20 @@ def award_thing(v, thing_type, id):
return {"error": "User is already permenantly marsified!"}, 403
if v.id != author.id:
if author.deflector and v.deflector:
msg = f"@{v.username} has tried to give your [{thing_type}]({thing.shortlink}) the {AWARDS[kind]['title']} Award but it was deflected on them, they also had a deflector up, so it bounced back and forth until it vaporized!"
send_repeatable_notification(author.id, msg)
msg = f"@{author.username} is under the effect of a deflector award; your {AWARDS[kind]['title']} Award has been deflected back to you but your deflector protected you, the award bounced back and forth until it vaporized!"
send_repeatable_notification(v.id, msg)
g.db.delete(award)
if request.referrer and len(request.referrer) > 1:
if request.referrer == f'{SITE_FULL}/submit': return redirect(thing.permalink)
elif request.referrer.startswith(f'{SITE_FULL}/'): return redirect(request.referrer)
return redirect(SITE_FULL)
if author.deflector and v.id != AEVANN_ID and (AWARDS[kind]['price'] > 500 or kind == 'marsify' or kind.istitle()) and kind not in ('pin','unpin','benefactor'):
msg = f"@{v.username} has tried to give your [{thing_type}]({thing.shortlink}) the {AWARDS[kind]['title']} Award but it was deflected and applied to them :marseytroll:"
send_repeatable_notification(author.id, msg)