pizza
This commit is contained in:
parent
ddb2256a9f
commit
be2be7b743
4 changed files with 18 additions and 1 deletions
|
@ -130,6 +130,7 @@ if SITE in {'rdrama.net','devrama.xyz'}:
|
|||
KIPPY_ID = 7150
|
||||
GIFT_NOTIF_ID = 995
|
||||
PIZZASHILL_ID = 2424
|
||||
PIZZASHILLSHILL_ID = 9712
|
||||
HIL_ID = 4245
|
||||
CRAT_ID = 747
|
||||
IDIO_ID = 30
|
||||
|
@ -160,6 +161,7 @@ elif SITE == "pcmemes.net":
|
|||
A_ID = 0
|
||||
KIPPY_ID = 1592
|
||||
PIZZASHILL_ID = 0
|
||||
PIZZASHILLSHILL_ID = 0
|
||||
GIFT_NOTIF_ID = 1592
|
||||
HIL_ID = 0
|
||||
CRAT_ID = 0
|
||||
|
@ -192,6 +194,7 @@ else:
|
|||
KIPPY_ID = 0
|
||||
GIFT_NOTIF_ID = 9
|
||||
PIZZASHILL_ID = 0
|
||||
PIZZASHILLSHILL_ID = 0
|
||||
HIL_ID = 0
|
||||
CRAT_ID = 0
|
||||
IDIO_ID = 0
|
||||
|
@ -693,6 +696,8 @@ snappy_url_regex = re.compile('<a href=\"(https?:\/\/[a-z]{1,20}\.[^\"]+)\" rel=
|
|||
|
||||
email_regex = re.compile('([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+', flags=re.A)
|
||||
|
||||
reddit_post_regex = re.compile('(https:\/\/old.reddit.com\/r\/\w{1,30}\/comments\/[a-z0-9]+).*', flags=re.A)
|
||||
|
||||
slur_regex = re.compile(rf"((?<=\s|>)|^)({single_words})((?=[\s<,.$]|s[\s<,.$]))", flags=re.I|re.A)
|
||||
slur_regex_upper = re.compile(rf"((?<=\s|>)|^)({single_words.upper()})((?=[\s<,.$]|S[\s<,.$]))", flags=re.A)
|
||||
torture_regex = re.compile('(^|\s)(i|me) ', flags=re.I|re.A)
|
||||
|
|
|
@ -226,6 +226,9 @@ def award_post(pid, v):
|
|||
|
||||
author = post.author
|
||||
|
||||
if author.id == PIZZASHILL_ID:
|
||||
return {"error": "Pizzashill is immune to awards."}, 403
|
||||
|
||||
if v.id != author.id:
|
||||
msg = f"@{v.username} has given your [post]({post.shortlink}) the {AWARDS[kind]['title']} Award!"
|
||||
if note: msg += f"\n\n> {note}"
|
||||
|
@ -444,6 +447,9 @@ def award_comment(cid, v):
|
|||
|
||||
author = c.author
|
||||
|
||||
if author.id == PIZZASHILL_ID:
|
||||
return {"error": "Pizzashill is immune to awards."}, 403
|
||||
|
||||
if v.id != author.id:
|
||||
msg = f"@{v.username} has given your [comment]({c.shortlink}) the {AWARDS[kind]['title']} Award!"
|
||||
if note: msg += f"\n\n> {note}"
|
||||
|
|
|
@ -661,6 +661,8 @@ def api_comment(v):
|
|||
g.db.add(autovote)
|
||||
autovote = CommentVote(user_id=CRAT_ID, comment_id=c.id, vote_type=1)
|
||||
g.db.add(autovote)
|
||||
autovote = CommentVote(user_id=PIZZASHILLSHILL_ID, comment_id=c.id, vote_type=1)
|
||||
g.db.add(autovote)
|
||||
v.coins += 3
|
||||
v.truecoins += 3
|
||||
g.db.add(v)
|
||||
|
|
|
@ -871,7 +871,9 @@ def submit_post(v, sub=None):
|
|||
|
||||
url = urlunparse(new_url)
|
||||
|
||||
search_url = url.replace('\\', '').replace('_', '\_').replace('%', '').strip()
|
||||
search_url = url.replace('%', '')
|
||||
search_url = reddit_post_regex.sub(r'\1%', search_url)
|
||||
search_url = search_url.replace('\\', '').replace('_', '\_').strip()
|
||||
|
||||
repost = g.db.query(Submission).filter(
|
||||
Submission.url.ilike(search_url),
|
||||
|
@ -1289,6 +1291,8 @@ def submit_post(v, sub=None):
|
|||
g.db.add(autovote)
|
||||
autovote = Vote(user_id=CRAT_ID, submission_id=post.id, vote_type=1)
|
||||
g.db.add(autovote)
|
||||
autovote = Vote(user_id=PIZZASHILLSHILL_ID, submission_id=post.id, vote_type=1)
|
||||
g.db.add(autovote)
|
||||
v.coins += 3
|
||||
v.truecoins += 3
|
||||
g.db.add(v)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue