master
Aevann1 2021-09-13 19:03:46 +02:00
parent 56c2638dea
commit c12cbcef72
6 changed files with 14 additions and 14 deletions

View File

@ -97,7 +97,7 @@ BASED_MSG = "@{username}'s Based Count has increased by 1. Their Based Count is
BASEDBOT_ACCOUNT = 800
NOTIFICATIONS_ACCOUNT = 1046
if site == "pcmemes.ga": AUTOJANNY_ACCOUNT = 1050
if site == "pcmemes.net": AUTOJANNY_ACCOUNT = 1050
else: AUTOJANNY_ACCOUNT = 2360
LONGPOSTBOT_ACCOUNT = 1832

View File

@ -11,7 +11,7 @@ AUTH = environ.get("DISCORD_AUTH",'').strip()
ROLES={
"linked": "849621030926286920",
"shrigma": "864612849199480914",
"admin": "879459632656048180" if environ.get("DOMAIN") == "pcmemes.ga" else "846509661288267776",
"admin": "879459632656048180" if environ.get("DOMAIN") == "pcmemes.net" else "846509661288267776",
"feedback": "850716291714383883",
"newuser": "854783259229421589",
"norep": "850971811918512208",

View File

@ -52,7 +52,7 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
if not pid:
if comment.parent_submission: pid = comment.parent_submission
elif "rdrama" in request.host: pid = 6489
elif 'pcmemes.ga' in request.host: pid = 382
elif 'pcmemes.net' in request.host: pid = 382
else: pid = 1
try: pid = int(pid)
@ -288,7 +288,7 @@ def api_comment(v):
g.db.rollback()
abort(413)
if 'pcmemes.ga' in request.host: url = upload_ibb(file=file)
if 'pcmemes.net' in request.host: url = upload_ibb(file=file)
else: url = upload_imgur(file=file)
body = request.form.get("body") + f"\n![]({url})"
@ -306,7 +306,7 @@ def api_comment(v):
g.db.add(c_aux)
g.db.flush()
if 'pcmemes.ga' in request.host and c_aux.body.lower().startswith("based"):
if 'pcmemes.net' in request.host and c_aux.body.lower().startswith("based"):
pill = re.match("based and (.{1,20}?)(-| )pilled", body, re.IGNORECASE)
c_based = Comment(author_id=BASEDBOT_ACCOUNT,
@ -702,7 +702,7 @@ def edit_comment(cid, v):
g.db.rollback()
abort(413)
if 'pcmemes.ga' in request.host: url = upload_ibb(file=file)
if 'pcmemes.net' in request.host: url = upload_ibb(file=file)
else: url = upload_imgur(file=file)
body += f"\n![]({url})"

View File

@ -527,7 +527,7 @@ def thumbs(new_post):
for chunk in image_req.iter_content(1024):
file.write(chunk)
if 'pcmemes.ga' in request.host: post.thumburl = upload_ibb(resize=True)
if 'pcmemes.net' in request.host: post.thumburl = upload_ibb(resize=True)
else: post.thumburl = upload_imgur(filepath="image.webp", resize=True)
g.db.add(post)
@ -914,7 +914,7 @@ def submit_post(v):
), 403
if file.content_type.startswith('image/'):
if 'pcmemes.ga' in request.host: new_post.url = upload_ibb(file=file)
if 'pcmemes.net' in request.host: new_post.url = upload_ibb(file=file)
else: new_post.url = upload_imgur(file=file)
else:
try:

View File

@ -117,7 +117,7 @@ def settings_profile_post(v):
if request.headers.get("Authorization"): return {"error": f"Image files only"}, 400
else: return render_template("settings_profile.html", v=v, error=f"Image files only."), 400
if 'pcmemes.ga' in request.host: url = upload_ibb(file=file)
if 'pcmemes.net' in request.host: url = upload_ibb(file=file)
else: url = upload_imgur(file=file)
bio += f"\n\n![]({url})"
@ -208,7 +208,7 @@ def settings_profile_post(v):
return {"message": "Theme changed!"}
quadrant = request.values.get("quadrant")
if quadrant and 'pcmemes.ga' in request.host.lower():
if quadrant and 'pcmemes.net' in request.host.lower():
v.quadrant = quadrant
v.customtitle = quadrant
if quadrant=="Centrist":
@ -505,7 +505,7 @@ def settings_images_profile(v):
filepath = f"image.{format}"
file.save(filepath)
if 'pcmemes.ga' in request.host:
if 'pcmemes.net' in request.host:
file = request.files["profile"]
file.save("image.webp")
highres = upload_ibb()
@ -517,7 +517,7 @@ def settings_images_profile(v):
highres = upload_imgur(filepath=filepath)
if not highres: abort(400)
if 'pcmemes.ga' in request.host: imageurl = upload_ibb(resize=True)
if 'pcmemes.net' in request.host: imageurl = upload_ibb(resize=True)
else: imageurl = upload_imgur(filepath=filepath, resize=True)
if not imageurl: abort(400)
@ -539,7 +539,7 @@ def settings_images_banner(v):
if request.headers.get("cf-ipcountry") == "T1": return "Image uploads are not allowed through TOR.", 403
file = request.files["banner"]
if 'pcmemes.ga' in request.host: imageurl = upload_ibb(file=file)
if 'pcmemes.net' in request.host: imageurl = upload_ibb(file=file)
else: imageurl = upload_imgur(file=file)
if imageurl:

View File

@ -144,7 +144,7 @@ def leaderboard(v):
users3 = users.order_by(User.post_count.desc()).limit(10).all()
users4 = users.order_by(User.comment_count.desc()).limit(10).all()
users5 = users.order_by(User.received_award_count.desc()).limit(10).all()
if 'pcmemes.ga' in request.host:
if 'pcmemes.net' in request.host:
users6 = users.order_by(User.basedcount.desc()).limit(10).all()
return render_template("leaderboard.html", v=v, users1=users1, users2=users2, users3=users3, users4=users4, users5=users5, users6=users6)
return render_template("leaderboard.html", v=v, users1=users1, users2=users2, users3=users3, users4=users4, users5=users5)