remotes/1693045480750635534/spooky-22
Aevann1 2022-01-19 14:44:05 +02:00
parent ea604e3738
commit 23a85eab1f
6 changed files with 19 additions and 21 deletions

View File

@ -30,7 +30,6 @@ services:
- COMMENT_SPAM_COUNT_THRESHOLD=10
- READ_ONLY=0
- BOT_DISABLE=0
- COINS_NAME=Dramacoins
- DEFAULT_TIME_FILTER=all
- DEFAULT_THEME=midnight
- DEFAULT_COLOR=ff66ac #YOU HAVE TO PICK ONE OF THOSE COLORS OR SHIT WILL BREAK: ff66ac, 805ad5, 62ca56, 38a169, 80ffff, 2a96f3, eb4963, ff0000, f39731, 30409f, 3e98a7, e4432d, 7b9ae4, ec72de, 7f8fa6, f8db58

View File

@ -18,7 +18,6 @@ valid_username_regex = re.compile("^[a-zA-Z0-9_\-]{3,25}$")
valid_password_regex = re.compile("^.{8,100}$")
YOUTUBE_KEY = environ.get("YOUTUBE_KEY", "").strip()
COINS_NAME = environ.get("COINS_NAME").strip()
GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip()
IMGUR_KEY = environ.get("IMGUR_KEY").strip()
GUMROAD_ID = environ.get("GUMROAD_ID", "tfcvri").strip()
@ -729,14 +728,14 @@ def settings_css(v):
@auth_required
def settings_profilecss_get(v):
if v.truecoins < 1000 and not v.patron and v.admin_level == 0 : return f"You must have +1000 {COINS_NAME} or be a paypig to set profile css."
if v.truecoins < 1000 and not v.patron and v.admin_level == 0 : return f"You must have +1000 truescore or be a paypig to set profile css."
return render_template("settings_profilecss.html", v=v)
@app.post("/settings/profilecss")
@limiter.limit("1/second;30/minute;200/hour;1000/day")
@auth_required
def settings_profilecss(v):
if v.truecoins < 1000 and not v.patron: return f"You must have +1000 {COINS_NAME} or be a paypig to set profile css."
if v.truecoins < 1000 and not v.patron: return f"You must have +1000 truescore or be a paypig to set profile css."
profilecss = request.values.get("profilecss").strip().replace('\\', '').strip()[:4000]
v.profilecss = profilecss
g.db.add(v)

View File

@ -253,9 +253,9 @@ def transfer_coins(v, username):
amount = request.values.get("amount", "").strip()
amount = int(amount) if amount.isdigit() else None
if amount is None or amount <= 0: return {"error": f"Invalid amount of {app.config['COINS_NAME']}."}, 400
if v.coins < amount: return {"error": f"You don't have enough {app.config['COINS_NAME']}"}, 400
if amount < 100: return {"error": f"You have to gift at least 100 {app.config['COINS_NAME']}."}, 400
if amount is None or amount <= 0: return {"error": f"Invalid amount of coins."}, 400
if v.coins < amount: return {"error": f"You don't have enough coins."}, 400
if amount < 100: return {"error": f"You have to gift at least 100 coins."}, 400
if not v.patron and not receiver.patron and not v.alts_patron and not receiver.alts_patron:
tax = math.ceil(amount*0.03)
@ -265,19 +265,19 @@ def transfer_coins(v, username):
else: tax = 0
if TAX_RECEIVER_ID:
log_message = f"@{v.username} has transferred {amount} {app.config['COINS_NAME']} to @{receiver.username}"
log_message = f"@{v.username} has transferred {amount} coins to @{receiver.username}"
send_repeatable_notification(TAX_RECEIVER_ID, log_message)
receiver.coins += amount-tax
v.coins -= amount
send_repeatable_notification(receiver.id, f":marseycapitalistmanlet: @{v.username} has gifted you {amount-tax} {app.config['COINS_NAME']}!")
send_repeatable_notification(receiver.id, f":marseycapitalistmanlet: @{v.username} has gifted you {amount-tax} coins!")
g.db.add(receiver)
g.db.add(v)
g.db.commit()
return {"message": f"{amount-tax} {app.config['COINS_NAME']} transferred!"}, 200
return {"message": f"{amount-tax} coins transferred!"}, 200
return {"message": f"You can't transfer {app.config['COINS_NAME']} to yourself!"}, 400
return {"message": f"You can't transfer coins to yourself!"}, 400
@app.post("/@<username>/transfer_bux")

View File

@ -95,7 +95,7 @@
<div><img alt="your profile picture" loading="lazy" src="{{v.profile_url}}" class="profile-pic-35"></div>
<div class="text-left pl-2">
<div style="color: #{{v.namecolor}}" class="text-small font-weight-bold {% if v.patron %}patron{% endif %}"><span {% if v.patron %}class="patron" style="background-color:#{{v.namecolor}}"{% endif %}>{{v.username}}</span></div>
<div class="text-small-extra text-primary"><img alt="{{'COINS_NAME' | app_config}}" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" height="13" src="/static/assets/images/marseycoin.webp?a=4" data-bs-original-title="{{'COINS_NAME' | app_config}}" aria-label="{{'COINS_NAME' | app_config}}"><span id="user-coins-amount">{{v.coins}}</span> {{'COINS_NAME' | app_config}}</div>
<div class="text-small-extra text-primary"><img alt="coins" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" height="13" src="/static/assets/images/marseycoin.webp?a=4" data-bs-original-title="coins" aria-label="coins"><span id="user-coins-amount">{{v.coins}}</span> coins</div>
<div class="text-small-extra text-primary"><img alt="marseybux" class="mr-1 ml-1" data-bs-toggle="tooltip" data-bs-placement="bottom" height="13" src="/static/assets/images/marseybux.webp?a=4" data-bs-original-title="Marseybux" aria-label="Marseybux"><span id="user-bux-amount">{{v.procoins}}</span> Marseybux</div>
</div>
</div>

View File

@ -4,7 +4,7 @@
{% block content %}
<pre class="d-none d-md-inline-block"></pre>
<h5 style="font-weight:bold;text-align: center">Top 25 by {{'COINS_NAME' | app_config}}</h5>
<h5 style="font-weight:bold;text-align: center">Top 25 by coins</h5>
<pre></pre>
<div class="overflow-x-auto"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">

View File

@ -13,7 +13,7 @@
<meta property="og:article:author" content="@{{u.username}}" >
<meta property="article:section" content="{{u.username}}'s profile - {{SITE_NAME}}" >
<meta property="article:published_time" content="{{u.created_date}}" >
<meta property="og:description" name="description" content="{{u.coins}} {{'COINS_NAME' | app_config}} - Joined {{u.created_date}} - {% if u.stored_subscriber_count >=1 and not u.is_private and not u.is_nofollow %}{{u.stored_subscriber_count}} Followers - {% endif %}{% if not u.is_private %} {{0 if u.shadowbanned else u.post_count}} Posts - {{0 if u.shadowbanned else u.comment_count}} Comments - {% endif %}{{u.bio}}">
<meta property="og:description" name="description" content="{{u.coins}} coins - Joined {{u.created_date}} - {% if u.stored_subscriber_count >=1 and not u.is_private and not u.is_nofollow %}{{u.stored_subscriber_count}} Followers - {% endif %}{% if not u.is_private %} {{0 if u.shadowbanned else u.post_count}} Posts - {{0 if u.shadowbanned else u.comment_count}} Comments - {% endif %}{{u.bio}}">
<meta property="og:author" name="author" content="@{{u.username}}" >
<meta property="og:title" content="{{u.username}}" >
<meta property="og:image" content="{{u.banner_url}}" >
@ -24,7 +24,7 @@
<meta name="twitter:site" content="{{request.host_url}}">
<meta name="twitter:title" content="{{u.username}}'s profile - {{SITE_NAME}}" >
<meta name="twitter:creator" content="@{{u.username}}">
<meta name="twitter:description" content="{{u.coins}} {{'COINS_NAME' | app_config}} - Joined {{u.created_date}} - {% if u.stored_subscriber_count >=1 and not u.is_private and not u.is_nofollow %}{{u.stored_subscriber_count}} Followers -{% endif %} {% if not u.is_private %} {{0 if u.shadowbanned else u.post_count}} Posts - {{0 if u.shadowbanned else u.comment_count}} Comments - {% endif %}{{u.bio}}">
<meta name="twitter:description" content="{{u.coins}} coins - Joined {{u.created_date}} - {% if u.stored_subscriber_count >=1 and not u.is_private and not u.is_nofollow %}{{u.stored_subscriber_count}} Followers -{% endif %} {% if not u.is_private %} {{0 if u.shadowbanned else u.post_count}} Posts - {{0 if u.shadowbanned else u.comment_count}} Comments - {% endif %}{{u.bio}}">
<meta name="twitter:image" content="{{u.banner_url}}" >
<meta name="twitter:url" content="{{u.url | full_link}}" >
{% endblock %}
@ -103,7 +103,7 @@
<div class="font-weight-bolder">
<span id="profile-coins-amount">{{u.coins}}</span>
<img alt="{{'COINS_NAME' | app_config}}" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="{{'COINS_NAME' | app_config}}" height="20" src="/static/assets/images/marseycoin.webp?a=4">&nbsp;&nbsp;
<img alt="coins" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="coins" height="20" src="/static/assets/images/marseycoin.webp?a=4">&nbsp;&nbsp;
<span id="profile-bux-amount">{{u.procoins}}</span>
<img alt="marseybux" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Marseybux" height="20" src="/static/assets/images/marseybux.webp?a=4">&nbsp;&nbsp;
@ -153,7 +153,7 @@
<a class="btn btn-primary" role="button" onclick="toggleElement('profile-toggleable', 'message')">Message</a>
<a class="btn btn-primary" role="button" onclick="post_toast('/@{{u.username}}/suicide')">Get them help</a>
<a class="btn btn-primary" role="button" onclick="toggleElement('profile-toggleable', 'coin-transfer')">Gift {{'COINS_NAME' | app_config}}</a>
<a class="btn btn-primary" role="button" onclick="toggleElement('profile-toggleable', 'coin-transfer')">Gift coins</a>
<a class="btn btn-primary" role="button" onclick="toggleElement('profile-toggleable', 'bux-transfer')">Gift Marseybux</a>
{% if v.admin_level > 2 %}
@ -191,7 +191,7 @@
<div class="d-none mt-3 profile-toggleable" id="coin-transfer">
<input autocomplete="off" id="coins-transfer-amount" class="form-control" name="amount" type="number" oninput="updateTax()">
<div>{{u.username}} will receive <span id="coins-transfer-taxed">0</span> {{'COINS_NAME' | app_config}}</div>
<div>{{u.username}} will receive <span id="coins-transfer-taxed">0</span> coins</div>
<button class="btn btn-primary mt-3" onclick="transferCoins()">Gift</button>
</div>
@ -377,7 +377,7 @@
<div class="font-weight-normal">
<span id="profile-coins-amount-mobile" class="font-weight-bold">{{u.coins}}</span>
<img alt="{{'COINS_NAME' | app_config}}" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="{{'COINS_NAME' | app_config}}" height="15" src="/static/assets/images/marseycoin.webp?a=4">&nbsp;&nbsp;
<img alt="coins" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="coins" height="15" src="/static/assets/images/marseycoin.webp?a=4">&nbsp;&nbsp;
<span id="profile-bux-amount-mobile" class="font-weight-bold">{{u.procoins}}</span>
<img alt="marseybux" class="ml-1 mb-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-original-title="Marseybux" height="15" src="/static/assets/images/marseybux.webp?a=4">&nbsp;&nbsp;
@ -441,7 +441,7 @@
<a id="button-sub2" class="btn btn-primary {% if is_following or u.is_nofollow or u.is_blocked %}d-none{% endif %}" role="button" onclick="post_toast2('/follow/{{u.username}}','button-unsub2','button-sub2')">Follow</a>
<a class="btn btn-primary" role="button" onclick="toggleElement('profile-toggleable-mobile', 'message-mobile')">Message</a>
<a class="btn btn-primary" role="button" onclick="post_toast('/@{{u.username}}/suicide')">Get them help</a>
<a class="btn btn-primary" role="button" onclick="toggleElement('profile-toggleable-mobile', 'coin-transfer-mobile')">Gift {{'COINS_NAME' | app_config}}</a>
<a class="btn btn-primary" role="button" onclick="toggleElement('profile-toggleable-mobile', 'coin-transfer-mobile')">Gift coins</a>
<a class="btn btn-primary" role="button" onclick="toggleElement('profile-toggleable', 'bux-transfer-mobile')">Gift Marseybux</a>
{% if v.admin_level > 2 %}
@ -479,7 +479,7 @@
<div class="d-none mt-3 profile-toggleable-mobile" id="coin-transfer-mobile">
<input autocomplete="off" id="coins-transfer-amount-mobile" class="form-control" name="amount" type="number" oninput="updateTax(true)">
<div>{{u.username}} will receive <span id="coins-transfer-taxed-mobile">0</span> {{'COINS_NAME' | app_config}}</div>
<div>{{u.username}} will receive <span id="coins-transfer-taxed-mobile">0</span> coins</div>
<button class="btn btn-primary mt-3" onclick="transferCoins(true)">Gift</button>
</div>