diff --git a/files/helpers/const.py b/files/helpers/const.py index bb3b9ef6d..efefc67b1 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -152,7 +152,7 @@ if SITE in {'rdrama.net','devrama.xyz'}: AUTOCHOICE_ID = 9167 BASEDBOT_ID = 0 - PW_ID = 3750 + MENTION_ID = 9376 KIPPY_ID = 7150 TAX_NOTIF_ID = 995 PIZZASHILL_ID = 2424 @@ -184,7 +184,7 @@ elif SITE == "pcmemes.net": AUTOCHOICE_ID = 2072 BASEDBOT_ID = 800 - PW_ID = 0 + MENTION_ID = 0 KIPPY_ID = 1592 PIZZASHILL_ID = 0 TAX_NOTIF_ID = 1592 @@ -216,7 +216,7 @@ else: AUTOCHOICE_ID = 8 BASEDBOT_ID = 0 - PW_ID = 0 + MENTION_ID = 0 KIPPY_ID = 0 TAX_NOTIF_ID = 9 PIZZASHILL_ID = 0 diff --git a/files/routes/subs.py b/files/routes/subs.py index 6e7cc2abe..2789c778e 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -256,10 +256,13 @@ def remove_mod(v, sub): @app.get("/create_sub") @is_not_permabanned def create_sub(v): - num = v.subs_created + 1 - for a in v.alts: - num += a.subs_created - cost = num * 100 + if v.id == MENTION_ID: cost = 0 + else: + num = v.subs_created + 1 + for a in v.alts: + num += a.subs_created + cost = num * 100 + 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() if not sub: - num = v.subs_created + 1 - for a in v.alts: - num += a.subs_created - cost = num * 100 + if v.id != MENTION_ID: + num = v.subs_created + 1 + for a in v.alts: + num += a.subs_created + cost = num * 100 - if v.coins < cost: - return render_template("sub/create_sub.html", v=v, error="You don't have enough coins!"), 403 + if v.coins < cost: + 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 g.db.add(v)