master
Aevann1 2022-02-26 11:23:56 +02:00
parent ca6eb51e6e
commit ea022d779a
2 changed files with 19 additions and 14 deletions

View File

@ -152,7 +152,7 @@ if SITE in {'rdrama.net','devrama.xyz'}:
AUTOCHOICE_ID = 9167 AUTOCHOICE_ID = 9167
BASEDBOT_ID = 0 BASEDBOT_ID = 0
PW_ID = 3750 MENTION_ID = 9376
KIPPY_ID = 7150 KIPPY_ID = 7150
TAX_NOTIF_ID = 995 TAX_NOTIF_ID = 995
PIZZASHILL_ID = 2424 PIZZASHILL_ID = 2424
@ -184,7 +184,7 @@ elif SITE == "pcmemes.net":
AUTOCHOICE_ID = 2072 AUTOCHOICE_ID = 2072
BASEDBOT_ID = 800 BASEDBOT_ID = 800
PW_ID = 0 MENTION_ID = 0
KIPPY_ID = 1592 KIPPY_ID = 1592
PIZZASHILL_ID = 0 PIZZASHILL_ID = 0
TAX_NOTIF_ID = 1592 TAX_NOTIF_ID = 1592
@ -216,7 +216,7 @@ else:
AUTOCHOICE_ID = 8 AUTOCHOICE_ID = 8
BASEDBOT_ID = 0 BASEDBOT_ID = 0
PW_ID = 0 MENTION_ID = 0
KIPPY_ID = 0 KIPPY_ID = 0
TAX_NOTIF_ID = 9 TAX_NOTIF_ID = 9
PIZZASHILL_ID = 0 PIZZASHILL_ID = 0

View File

@ -256,10 +256,13 @@ def remove_mod(v, sub):
@app.get("/create_sub") @app.get("/create_sub")
@is_not_permabanned @is_not_permabanned
def create_sub(v): def create_sub(v):
num = v.subs_created + 1 if v.id == MENTION_ID: cost = 0
for a in v.alts: else:
num += a.subs_created num = v.subs_created + 1
cost = num * 100 for a in v.alts:
num += a.subs_created
cost = num * 100
return render_template("sub/create_sub.html", v=v, cost=cost) return render_template("sub/create_sub.html", v=v, cost=cost)
@ -275,15 +278,17 @@ def create_sub2(v):
sub = g.db.query(Sub).filter_by(name=name).one_or_none() sub = g.db.query(Sub).filter_by(name=name).one_or_none()
if not sub: if not sub:
num = v.subs_created + 1 if v.id != MENTION_ID:
for a in v.alts: num = v.subs_created + 1
num += a.subs_created for a in v.alts:
cost = num * 100 num += a.subs_created
cost = num * 100
if v.coins < cost: if v.coins < cost:
return render_template("sub/create_sub.html", v=v, error="You don't have enough coins!"), 403 return render_template("sub/create_sub.html", v=v, error="You don't have enough coins!"), 403
v.coins -= cost
v.coins -= cost
v.subs_created += 1 v.subs_created += 1
g.db.add(v) g.db.add(v)