ggf
This commit is contained in:
parent
e8026b7b26
commit
ab62802145
3 changed files with 33 additions and 0 deletions
BIN
files/assets/images/badges/Benefactor.webp
Normal file
BIN
files/assets/images/badges/Benefactor.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 138 KiB |
|
@ -463,6 +463,10 @@ BADGES = {
|
||||||
'name': 'Christmas 21',
|
'name': 'Christmas 21',
|
||||||
'description': 'Awarded for surviving Fistmas 2021'
|
'description': 'Awarded for surviving Fistmas 2021'
|
||||||
},
|
},
|
||||||
|
103: {
|
||||||
|
'name': 'Benefactor',
|
||||||
|
'description': 'Gave the Benefactor award to someone'
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
AWARDS = {
|
AWARDS = {
|
||||||
|
@ -682,6 +686,14 @@ AWARDS = {
|
||||||
"color": "text-success",
|
"color": "text-success",
|
||||||
"price": 3500
|
"price": 3500
|
||||||
},
|
},
|
||||||
|
"benefactor": {
|
||||||
|
"kind": "benefactor",
|
||||||
|
"title": "Benefactor",
|
||||||
|
"description": "Grants one month of paypig status and 2500 marseybux to the recipient. Cannot be used on yourself.",
|
||||||
|
"icon": "fas fa-gift",
|
||||||
|
"color": "text-purple",
|
||||||
|
"price": 4000
|
||||||
|
},
|
||||||
"grass": {
|
"grass": {
|
||||||
"kind": "grass",
|
"kind": "grass",
|
||||||
"title": "Grass",
|
"title": "Grass",
|
||||||
|
|
|
@ -215,6 +215,10 @@ def award_post(pid, v):
|
||||||
send_repeatable_notification(post.author.id, msg)
|
send_repeatable_notification(post.author.id, msg)
|
||||||
|
|
||||||
author = post.author
|
author = post.author
|
||||||
|
|
||||||
|
if kind == "benefactor" and author.id == v.id:
|
||||||
|
return {"error": "You can't use this award on yourself."}, 400
|
||||||
|
|
||||||
if kind == "ban":
|
if kind == "ban":
|
||||||
link = f"[this post]({post.permalink})"
|
link = f"[this post]({post.permalink})"
|
||||||
|
|
||||||
|
@ -350,6 +354,13 @@ def award_post(pid, v):
|
||||||
badge = Badge(user_id=author.id, badge_id=94)
|
badge = Badge(user_id=author.id, badge_id=94)
|
||||||
g.db.add(badge)
|
g.db.add(badge)
|
||||||
send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n\n\n{badge.name}")
|
send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n\n\n{badge.name}")
|
||||||
|
elif kind == "benefactor":
|
||||||
|
author.patron = 1
|
||||||
|
author.procoins += 2500
|
||||||
|
if not v.has_badge(103):
|
||||||
|
badge = Badge(user_id=v.id, badge_id=103)
|
||||||
|
g.db.add(badge)
|
||||||
|
send_notification(v.id, f"@AutoJanny has given you the following profile badge:\n\n\n\n{badge.name}")
|
||||||
|
|
||||||
if post.author.received_award_count: post.author.received_award_count += 1
|
if post.author.received_award_count: post.author.received_award_count += 1
|
||||||
else: post.author.received_award_count = 1
|
else: post.author.received_award_count = 1
|
||||||
|
@ -403,6 +414,9 @@ def award_comment(cid, v):
|
||||||
|
|
||||||
author = c.author
|
author = c.author
|
||||||
|
|
||||||
|
if kind == "benefactor" and author.id == v.id:
|
||||||
|
return {"error": "You can't use this award on yourself."}, 400
|
||||||
|
|
||||||
if kind == "ban":
|
if kind == "ban":
|
||||||
link = f"[this comment]({c.permalink})"
|
link = f"[this comment]({c.permalink})"
|
||||||
|
|
||||||
|
@ -535,6 +549,13 @@ def award_comment(cid, v):
|
||||||
badge = Badge(user_id=author.id, badge_id=94)
|
badge = Badge(user_id=author.id, badge_id=94)
|
||||||
g.db.add(badge)
|
g.db.add(badge)
|
||||||
send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n\n\n{badge.name}")
|
send_notification(author.id, f"@AutoJanny has given you the following profile badge:\n\n\n\n{badge.name}")
|
||||||
|
elif kind == "benefactor":
|
||||||
|
author.patron = 1
|
||||||
|
author.procoins += 2500
|
||||||
|
if not v.has_badge(103):
|
||||||
|
badge = Badge(user_id=v.id, badge_id=103)
|
||||||
|
g.db.add(badge)
|
||||||
|
send_notification(v.id, f"@AutoJanny has given you the following profile badge:\n\n\n\n{badge.name}")
|
||||||
|
|
||||||
if c.author.received_award_count: c.author.received_award_count += 1
|
if c.author.received_award_count: c.author.received_award_count += 1
|
||||||
else: c.author.received_award_count = 1
|
else: c.author.received_award_count = 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue