forked from rDrama/rDrama
Merge branch 'master' of https://fsdfsd.net/rDrama/rDrama
commit
6c55e4d47e
|
@ -29,8 +29,7 @@ from .lottery import *
|
||||||
from .casino_game import *
|
from .casino_game import *
|
||||||
from .hats import *
|
from .hats import *
|
||||||
from .marsey import *
|
from .marsey import *
|
||||||
if KOFI_TOKEN:
|
from .transactions import *
|
||||||
from .transactions import *
|
|
||||||
from .sub_logs import *
|
from .sub_logs import *
|
||||||
from .media import *
|
from .media import *
|
||||||
from .push_subscriptions import *
|
from .push_subscriptions import *
|
||||||
|
|
|
@ -404,7 +404,7 @@ def themecolor(v):
|
||||||
@limiter.limit(DEFAULT_RATELIMIT_SLOWER)
|
@limiter.limit(DEFAULT_RATELIMIT_SLOWER)
|
||||||
@limiter.limit(DEFAULT_RATELIMIT_SLOWER, key_func=get_ID)
|
@limiter.limit(DEFAULT_RATELIMIT_SLOWER, key_func=get_ID)
|
||||||
@auth_required
|
@auth_required
|
||||||
def gumroad(v):
|
def settings_gumroad(v):
|
||||||
if GUMROAD_TOKEN == DEFAULT_CONFIG_VALUE: abort(404)
|
if GUMROAD_TOKEN == DEFAULT_CONFIG_VALUE: abort(404)
|
||||||
if not (v.email and v.is_activated):
|
if not (v.email and v.is_activated):
|
||||||
abort(400, f"You must have a verified email to verify {patron} status and claim your rewards!")
|
abort(400, f"You must have a verified email to verify {patron} status and claim your rewards!")
|
||||||
|
|
|
@ -1277,7 +1277,7 @@ def bid_list(v:User, bid):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
kofi_tiers={
|
tiers={
|
||||||
3: 1,
|
3: 1,
|
||||||
5: 1,
|
5: 1,
|
||||||
10: 2,
|
10: 2,
|
||||||
|
@ -1295,7 +1295,7 @@ def claim_rewards(v):
|
||||||
marseybux = 0
|
marseybux = 0
|
||||||
|
|
||||||
for transaction in transactions:
|
for transaction in transactions:
|
||||||
tier = kofi_tiers[transaction.amount]
|
tier = tiers[transaction.amount]
|
||||||
marseybux += marseybux_li[tier]
|
marseybux += marseybux_li[tier]
|
||||||
if tier > highest_tier:
|
if tier > highest_tier:
|
||||||
highest_tier = tier
|
highest_tier = tier
|
||||||
|
@ -1347,6 +1347,38 @@ def kofi():
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
@app.post("/gumroad")
|
||||||
|
def gumroad():
|
||||||
|
data = request.values
|
||||||
|
ip = request.headers.get('CF-Connecting-IP')
|
||||||
|
if ip != '34.193.146.117':
|
||||||
|
print('\n\n\n-----------------------\n\n\ngumroad: ' + ip + '\n\n\n-----------------------\n\n\n')
|
||||||
|
abort(400)
|
||||||
|
|
||||||
|
id = data['sale_id']
|
||||||
|
created_utc = time.time()
|
||||||
|
type = data['recurrence']
|
||||||
|
amount = int(data['price'])
|
||||||
|
email = data['email']
|
||||||
|
|
||||||
|
transaction = Transaction(
|
||||||
|
id=id,
|
||||||
|
created_utc=created_utc,
|
||||||
|
type=type,
|
||||||
|
amount=amount,
|
||||||
|
email=email
|
||||||
|
)
|
||||||
|
|
||||||
|
g.db.add(transaction)
|
||||||
|
|
||||||
|
user = g.db.query(User).filter_by(email=email, is_activated=True).order_by(User.truescore.desc()).first()
|
||||||
|
# if user:
|
||||||
|
# claim_rewards(user)
|
||||||
|
|
||||||
|
return ''
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@app.post("/settings/kofi")
|
@app.post("/settings/kofi")
|
||||||
@limiter.limit(DEFAULT_RATELIMIT_SLOWER)
|
@limiter.limit(DEFAULT_RATELIMIT_SLOWER)
|
||||||
|
|
Loading…
Reference in New Issue