vcx
This commit is contained in:
parent
a2e42a822d
commit
f69c40f7f9
2 changed files with 21 additions and 11 deletions
|
@ -56,6 +56,8 @@ AWARDS3 = {
|
|||
@app.get("/settings/shop")
|
||||
@auth_required
|
||||
def shop(v):
|
||||
if request.host == 'pcmemes.net': abort(403)
|
||||
|
||||
AWARDS = deepcopy(AWARDS2)
|
||||
|
||||
for val in AWARDS.values(): val["owned"] = 0
|
||||
|
@ -84,6 +86,8 @@ def shop(v):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def buy(v, award):
|
||||
if request.host == 'pcmemes.net': abort(403)
|
||||
|
||||
if award == 'benefactor' and not request.values.get("mb"):
|
||||
return {"error": "You can only buy the Benefactor award with marseybux."}, 403
|
||||
|
||||
|
@ -191,6 +195,7 @@ def buy(v, award):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def award_post(pid, v):
|
||||
if request.host == 'pcmemes.net': abort(403)
|
||||
|
||||
if v.shadowbanned: return render_template('errors/500.html', err=True, v=v), 500
|
||||
|
||||
|
@ -414,6 +419,7 @@ def award_post(pid, v):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def award_comment(cid, v):
|
||||
if request.host == 'pcmemes.net': abort(403)
|
||||
|
||||
if v.shadowbanned: return render_template('errors/500.html', err=True, v=v), 500
|
||||
|
||||
|
@ -627,6 +633,7 @@ def award_comment(cid, v):
|
|||
@app.get("/admin/awards")
|
||||
@admin_level_required(2)
|
||||
def admin_userawards_get(v):
|
||||
if request.host == 'pcmemes.net': abort(403)
|
||||
|
||||
if v.admin_level != 3:
|
||||
return render_template("admin/awards.html", awards=list(AWARDS3.values()), v=v)
|
||||
|
@ -637,6 +644,7 @@ def admin_userawards_get(v):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@admin_level_required(2)
|
||||
def admin_userawards_post(v):
|
||||
if request.host == 'pcmemes.net': abort(403)
|
||||
|
||||
try: u = request.values.get("username").strip()
|
||||
except: abort(404)
|
||||
|
|
|
@ -18,15 +18,15 @@ from os import path
|
|||
import requests
|
||||
from shutil import copyfile
|
||||
|
||||
# db = db_session()
|
||||
# marseys = tuple(f':#{x[0]}:' for x in db.query(Marsey.name).all())
|
||||
# db.close()
|
||||
db = db_session()
|
||||
marseys = tuple(f':#{x[0]}:' for x in db.query(Marsey.name).all())
|
||||
db.close()
|
||||
|
||||
# if path.exists(f'snappy_{SITE_NAME}.txt'):
|
||||
# with open(f'snappy_{SITE_NAME}.txt', "r") as f:
|
||||
# if SITE == 'pcmemes.net': snappyquotes = tuple(f.read().split("{[para]}"))
|
||||
# else: snappyquotes = tuple(f.read().split("{[para]}")) + marseys
|
||||
# else: snappyquotes = marseys
|
||||
if path.exists(f'snappy_{SITE_NAME}.txt'):
|
||||
with open(f'snappy_{SITE_NAME}.txt', "r") as f:
|
||||
if SITE == 'pcmemes.net': snappyquotes = tuple(f.read().split("{[para]}"))
|
||||
else: snappyquotes = tuple(f.read().split("{[para]}")) + marseys
|
||||
else: snappyquotes = marseys
|
||||
|
||||
IMGUR_KEY = environ.get("IMGUR_KEY").strip()
|
||||
|
||||
|
@ -1025,7 +1025,8 @@ def submit_post(v):
|
|||
elif v.id == LAWLZ_ID:
|
||||
if random.random() < 0.5: body = "wow, this lawlzpost sucks!"
|
||||
else: body = "wow, a good lawlzpost for once!"
|
||||
else: body = '!slots10000'
|
||||
elif request.host == 'rdrama.net': body = '!slots10000'
|
||||
else: body = random.choice(snappyquotes)
|
||||
body += "\n\n"
|
||||
|
||||
if new_post.url:
|
||||
|
@ -1079,6 +1080,7 @@ def submit_post(v):
|
|||
n = Notification(comment_id=c.id, user_id=v.id)
|
||||
g.db.add(n)
|
||||
|
||||
if request.host == 'rdrama.net':
|
||||
slots = Slots(g)
|
||||
slots.check_for_slots_command(body, snappy, c)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue