add gigapin award

master
Aevann 2024-10-21 20:13:53 +03:00
parent 5db80e348a
commit 9d825cc376
2 changed files with 18 additions and 1 deletions

View File

@ -785,6 +785,20 @@ AWARDS = {
"negative": False,
"included_in_lootbox": False,
},
"gigapin": {
"kind": "gigapin",
"title": "Giga Pin",
"description": "Pins a post for 12 hour or a comment for 72 hours.",
"icon": "fas fa-thumbtack fa-rotate--45",
"color": "text-danger",
"price": 14000,
"deflectable": False,
"cosmetic": False,
"ghost": True,
"enabled": lambda v:True,
"negative": False,
"included_in_lootbox": False,
},
"progressivestack": {
"kind": "progressivestack",
"title": "Progressive Stack",

View File

@ -471,7 +471,7 @@ def award_thing(v, thing_type, id):
if author.spider: author.spider += 86400 * quantity
else: author.spider = int(time.time()) + 86400 * quantity
badge_grant(user=author, badge_id=179, notify=False)
elif kind == "pin":
elif kind in {"pin", "gigapin"}:
if not FEATURES['PINS']: stop(403)
if obj.is_banned: stop(403)
@ -484,6 +484,9 @@ def award_thing(v, thing_type, id):
if isinstance(obj, Comment): add = 3600*6 * quantity
else: add = 3600 * quantity
if kind == "gigapin":
add *= 12
if obj.pinned_utc:
obj.pinned_utc += add
else: