forked from MarseyWorld/MarseyWorld
allow deux jannies to add badges
parent
f585597401
commit
f7c2befeed
|
@ -195,6 +195,24 @@ LOTTERY_TICKET_COST = 12
|
||||||
LOTTERY_SINK_RATE = 3
|
LOTTERY_SINK_RATE = 3
|
||||||
LOTTERY_DURATION = 60 * 60 * 24 * 7
|
LOTTERY_DURATION = 60 * 60 * 24 * 7
|
||||||
|
|
||||||
|
SIDEBAR_THREAD = 0
|
||||||
|
BANNER_THREAD = 0
|
||||||
|
BADGE_THREAD = 0
|
||||||
|
SNAPPY_THREAD = 0
|
||||||
|
MARSEY_THREAD = 0
|
||||||
|
GAMBLING_THREAD = 0
|
||||||
|
|
||||||
|
if SITE in ('rdrama.net', 'devrama.xyz'):
|
||||||
|
SIDEBAR_THREAD = 37696
|
||||||
|
BANNER_THREAD = 37697
|
||||||
|
BADGE_THREAD = 37833
|
||||||
|
SNAPPY_THREAD = 37749
|
||||||
|
MARSEY_THREAD = 37838
|
||||||
|
GAMBLING_THREAD = 39413
|
||||||
|
elif SITE == 'deuxrama.net':
|
||||||
|
BADGE_THREAD = 142
|
||||||
|
|
||||||
|
|
||||||
if SITE in {'rdrama.net', 'devrama.xyz', 'deuxrama.net'}:
|
if SITE in {'rdrama.net', 'devrama.xyz', 'deuxrama.net'}:
|
||||||
HOLE_COST = 50000
|
HOLE_COST = 50000
|
||||||
HOLE_INACTIVITY_DELETION = True
|
HOLE_INACTIVITY_DELETION = True
|
||||||
|
@ -882,7 +900,7 @@ if path.exists(f'snappy_{snappy_name}.txt'):
|
||||||
|
|
||||||
YOUTUBE_KEY = environ.get("YOUTUBE_KEY", "").strip()
|
YOUTUBE_KEY = environ.get("YOUTUBE_KEY", "").strip()
|
||||||
|
|
||||||
ADMIGGERS = (37696,37697,37749,37833,37838,39413)
|
ADMIGGERS = {SIDEBAR_THREAD,BANNER_THREAD,BADGE_THREAD,SNAPPY_THREAD,MARSEY_THREAD,GAMBLING_THREAD}
|
||||||
|
|
||||||
proxies = {"http":"http://127.0.0.1:18080","https":"http://127.0.0.1:18080"}
|
proxies = {"http":"http://127.0.0.1:18080","https":"http://127.0.0.1:18080"}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ def inject_constants():
|
||||||
"AUTOJANNY_ID":AUTOJANNY_ID, "PUSHER_ID":PUSHER_ID,
|
"AUTOJANNY_ID":AUTOJANNY_ID, "PUSHER_ID":PUSHER_ID,
|
||||||
"CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID,
|
"CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID,
|
||||||
"PIZZASHILL_ID":PIZZASHILL_ID, "DEFAULT_COLOR":DEFAULT_COLOR,
|
"PIZZASHILL_ID":PIZZASHILL_ID, "DEFAULT_COLOR":DEFAULT_COLOR,
|
||||||
"COLORS":COLORS, "ADMIGGERS":ADMIGGERS, "time":time,
|
"COLORS":COLORS, "time":time,
|
||||||
"HOLE_NAME": HOLE_NAME, "HOLE_STYLE_FLAIR": HOLE_STYLE_FLAIR, "HOLE_REQUIRED": HOLE_REQUIRED,
|
"HOLE_NAME": HOLE_NAME, "HOLE_STYLE_FLAIR": HOLE_STYLE_FLAIR, "HOLE_REQUIRED": HOLE_REQUIRED,
|
||||||
"LOTTERY_ENABLED": LOTTERY_ENABLED, "GUMROAD_LINK": GUMROAD_LINK,
|
"LOTTERY_ENABLED": LOTTERY_ENABLED, "GUMROAD_LINK": GUMROAD_LINK,
|
||||||
"DEFAULT_THEME": DEFAULT_THEME, "DESCRIPTION": DESCRIPTION, "PERMS": PERMS,
|
"DEFAULT_THEME": DEFAULT_THEME, "DESCRIPTION": DESCRIPTION, "PERMS": PERMS,
|
||||||
|
|
|
@ -196,21 +196,21 @@ def api_comment(v):
|
||||||
image = process_image(oldname)
|
image = process_image(oldname)
|
||||||
if image == "": return {"error":"Image upload failed"}
|
if image == "": return {"error":"Image upload failed"}
|
||||||
if v.admin_level > 2 and level == 1:
|
if v.admin_level > 2 and level == 1:
|
||||||
if parent_post.id == 37696:
|
if parent_post.id == SIDEBAR_THREAD:
|
||||||
li = sorted(os.listdir(f'files/assets/images/{SITE_NAME}/sidebar'),
|
li = sorted(os.listdir(f'files/assets/images/{SITE_NAME}/sidebar'),
|
||||||
key=lambda e: int(e.split('.webp')[0]))[-1]
|
key=lambda e: int(e.split('.webp')[0]))[-1]
|
||||||
num = int(li.split('.webp')[0]) + 1
|
num = int(li.split('.webp')[0]) + 1
|
||||||
filename = f'files/assets/images/{SITE_NAME}/sidebar/{num}.webp'
|
filename = f'files/assets/images/{SITE_NAME}/sidebar/{num}.webp'
|
||||||
copyfile(oldname, filename)
|
copyfile(oldname, filename)
|
||||||
process_image(filename, 400)
|
process_image(filename, 400)
|
||||||
elif parent_post.id == 37697:
|
elif parent_post.id == BANNER_THREAD:
|
||||||
li = sorted(os.listdir(f'files/assets/images/{SITE_NAME}/banners'),
|
li = sorted(os.listdir(f'files/assets/images/{SITE_NAME}/banners'),
|
||||||
key=lambda e: int(e.split('.webp')[0]))[-1]
|
key=lambda e: int(e.split('.webp')[0]))[-1]
|
||||||
num = int(li.split('.webp')[0]) + 1
|
num = int(li.split('.webp')[0]) + 1
|
||||||
filename = f'files/assets/images/{SITE_NAME}/banners/{num}.webp'
|
filename = f'files/assets/images/{SITE_NAME}/banners/{num}.webp'
|
||||||
copyfile(oldname, filename)
|
copyfile(oldname, filename)
|
||||||
process_image(filename)
|
process_image(filename)
|
||||||
elif parent_post.id == 37833:
|
elif parent_post.id == BADGE_THREAD:
|
||||||
try:
|
try:
|
||||||
badge_def = loads(body)
|
badge_def = loads(body)
|
||||||
name = badge_def["name"]
|
name = badge_def["name"]
|
||||||
|
@ -228,7 +228,7 @@ def api_comment(v):
|
||||||
data=f'{{"files": ["https://{request.host}/assets/images/badges/{badge.id}.webp"]}}', timeout=5)
|
data=f'{{"files": ["https://{request.host}/assets/images/badges/{badge.id}.webp"]}}', timeout=5)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return {"error": str(e)}, 400
|
return {"error": str(e)}, 400
|
||||||
elif v.admin_level > 2 and parent_post.id == 37838:
|
elif v.admin_level > 2 and parent_post.id == MARSEY_THREAD:
|
||||||
try:
|
try:
|
||||||
marsey = loads(body.lower())
|
marsey = loads(body.lower())
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ def api_comment(v):
|
||||||
|
|
||||||
body = body.strip()
|
body = body.strip()
|
||||||
|
|
||||||
if v.admin_level > 2 and parent_post.id == 37749 and level == 1:
|
if v.admin_level > 2 and parent_post.id == SNAPPY_THREAD and level == 1:
|
||||||
with open(f"snappy_{SITE_NAME}.txt", "a", encoding="utf-8") as f:
|
with open(f"snappy_{SITE_NAME}.txt", "a", encoding="utf-8") as f:
|
||||||
f.write('\n{[para]}\n' + body)
|
f.write('\n{[para]}\n' + body)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue