forked from rDrama/rDrama
remove unnecessary feature_required flags, moving them to the routes import
parent
1e931b4d05
commit
022a81a4b9
|
@ -32,9 +32,11 @@ from .static import *
|
||||||
from .users import *
|
from .users import *
|
||||||
from .votes import *
|
from .votes import *
|
||||||
from .feeds import *
|
from .feeds import *
|
||||||
|
if FEATURES['AWARDS']:
|
||||||
from .awards import *
|
from .awards import *
|
||||||
from .giphy import *
|
from .giphy import *
|
||||||
from .subs import *
|
from .subs import *
|
||||||
|
if FEATURES['GAMBLING']:
|
||||||
from .lottery import *
|
from .lottery import *
|
||||||
from .casino import *
|
from .casino import *
|
||||||
from .polls import *
|
from .polls import *
|
||||||
|
|
|
@ -21,7 +21,6 @@ from .front import frontlist
|
||||||
|
|
||||||
@app.get("/shop")
|
@app.get("/shop")
|
||||||
@app.get("/settings/shop")
|
@app.get("/settings/shop")
|
||||||
@feature_required('AWARDS')
|
|
||||||
@auth_required
|
@auth_required
|
||||||
def shop(v):
|
def shop(v):
|
||||||
AWARDS = deepcopy(AWARDS2)
|
AWARDS = deepcopy(AWARDS2)
|
||||||
|
@ -45,7 +44,6 @@ def shop(v):
|
||||||
|
|
||||||
|
|
||||||
@app.post("/buy/<award>")
|
@app.post("/buy/<award>")
|
||||||
@feature_required('AWARDS')
|
|
||||||
@limiter.limit("100/minute;200/hour;1000/day")
|
@limiter.limit("100/minute;200/hour;1000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def buy(v, award):
|
def buy(v, award):
|
||||||
|
@ -125,7 +123,6 @@ def buy(v, award):
|
||||||
return {"message": f"{award_title} award bought!"}
|
return {"message": f"{award_title} award bought!"}
|
||||||
|
|
||||||
@app.post("/award/<thing_type>/<id>")
|
@app.post("/award/<thing_type>/<id>")
|
||||||
@feature_required('AWARDS')
|
|
||||||
@limiter.limit(DEFAULT_RATELIMIT_SLOWER)
|
@limiter.limit(DEFAULT_RATELIMIT_SLOWER)
|
||||||
@is_not_permabanned
|
@is_not_permabanned
|
||||||
@ratelimit_user()
|
@ratelimit_user()
|
||||||
|
|
|
@ -12,7 +12,6 @@ from files.routes.wrappers import *
|
||||||
from files.__main__ import app, limiter
|
from files.__main__ import app, limiter
|
||||||
|
|
||||||
@app.get("/casino")
|
@app.get("/casino")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def casino(v):
|
def casino(v):
|
||||||
|
@ -23,7 +22,6 @@ def casino(v):
|
||||||
|
|
||||||
|
|
||||||
@app.get("/casino/<game>")
|
@app.get("/casino/<game>")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def casino_game_page(v, game):
|
def casino_game_page(v, game):
|
||||||
|
@ -51,7 +49,6 @@ def casino_game_page(v, game):
|
||||||
|
|
||||||
|
|
||||||
@app.get("/casino/<game>/feed")
|
@app.get("/casino/<game>/feed")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def casino_game_feed(v, game):
|
def casino_game_feed(v, game):
|
||||||
|
@ -66,7 +63,6 @@ def casino_game_feed(v, game):
|
||||||
|
|
||||||
# Lottershe
|
# Lottershe
|
||||||
@app.get("/lottershe")
|
@app.get("/lottershe")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def lottershe(v):
|
def lottershe(v):
|
||||||
|
@ -78,7 +74,6 @@ def lottershe(v):
|
||||||
|
|
||||||
# Slots
|
# Slots
|
||||||
@app.post("/casino/slots")
|
@app.post("/casino/slots")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def pull_slots(v):
|
def pull_slots(v):
|
||||||
|
@ -109,7 +104,6 @@ def pull_slots(v):
|
||||||
|
|
||||||
# 21
|
# 21
|
||||||
@app.post("/casino/twentyone/deal")
|
@app.post("/casino/twentyone/deal")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
|
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def blackjack_deal_to_player(v):
|
def blackjack_deal_to_player(v):
|
||||||
|
@ -129,7 +123,6 @@ def blackjack_deal_to_player(v):
|
||||||
|
|
||||||
|
|
||||||
@app.post("/casino/twentyone/hit")
|
@app.post("/casino/twentyone/hit")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
|
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def blackjack_player_hit(v):
|
def blackjack_player_hit(v):
|
||||||
|
@ -145,7 +138,6 @@ def blackjack_player_hit(v):
|
||||||
|
|
||||||
|
|
||||||
@app.post("/casino/twentyone/stay")
|
@app.post("/casino/twentyone/stay")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
|
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def blackjack_player_stay(v):
|
def blackjack_player_stay(v):
|
||||||
|
@ -161,7 +153,6 @@ def blackjack_player_stay(v):
|
||||||
|
|
||||||
|
|
||||||
@app.post("/casino/twentyone/double-down")
|
@app.post("/casino/twentyone/double-down")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
|
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def blackjack_player_doubled_down(v):
|
def blackjack_player_doubled_down(v):
|
||||||
|
@ -177,7 +168,6 @@ def blackjack_player_doubled_down(v):
|
||||||
|
|
||||||
|
|
||||||
@app.post("/casino/twentyone/buy-insurance")
|
@app.post("/casino/twentyone/buy-insurance")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
|
@limiter.limit("1/second;100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def blackjack_player_bought_insurance(v):
|
def blackjack_player_bought_insurance(v):
|
||||||
|
@ -193,7 +183,6 @@ def blackjack_player_bought_insurance(v):
|
||||||
|
|
||||||
# Roulette
|
# Roulette
|
||||||
@app.get("/casino/roulette/bets")
|
@app.get("/casino/roulette/bets")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def roulette_get_bets(v):
|
def roulette_get_bets(v):
|
||||||
|
@ -206,7 +195,6 @@ def roulette_get_bets(v):
|
||||||
|
|
||||||
|
|
||||||
@app.post("/casino/roulette/place-bet")
|
@app.post("/casino/roulette/place-bet")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@limiter.limit("100/minute;2000/hour;12000/day")
|
@limiter.limit("100/minute;2000/hour;12000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def roulette_player_placed_bet(v):
|
def roulette_player_placed_bet(v):
|
||||||
|
|
|
@ -9,7 +9,6 @@ from files.routes.wrappers import *
|
||||||
from files.__main__ import app, limiter
|
from files.__main__ import app, limiter
|
||||||
|
|
||||||
@app.post("/lottery/end")
|
@app.post("/lottery/end")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@admin_level_required(PERMS['LOTTERY_ADMIN'])
|
@admin_level_required(PERMS['LOTTERY_ADMIN'])
|
||||||
def lottery_end(v):
|
def lottery_end(v):
|
||||||
success, message = end_lottery_session()
|
success, message = end_lottery_session()
|
||||||
|
@ -17,7 +16,6 @@ def lottery_end(v):
|
||||||
|
|
||||||
|
|
||||||
@app.post("/lottery/start")
|
@app.post("/lottery/start")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@admin_level_required(PERMS['LOTTERY_ADMIN'])
|
@admin_level_required(PERMS['LOTTERY_ADMIN'])
|
||||||
def lottery_start(v):
|
def lottery_start(v):
|
||||||
start_new_lottery_session()
|
start_new_lottery_session()
|
||||||
|
@ -25,7 +23,6 @@ def lottery_start(v):
|
||||||
|
|
||||||
|
|
||||||
@app.post("/lottery/buy")
|
@app.post("/lottery/buy")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@limiter.limit("3/second;100/minute;500/hour;1000/day")
|
@limiter.limit("3/second;100/minute;500/hour;1000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def lottery_buy(v):
|
def lottery_buy(v):
|
||||||
|
@ -43,7 +40,6 @@ def lottery_buy(v):
|
||||||
|
|
||||||
|
|
||||||
@app.get("/lottery/active")
|
@app.get("/lottery/active")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@limiter.limit("3/second;100/minute;500/hour;1000/day")
|
@limiter.limit("3/second;100/minute;500/hour;1000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def lottery_active(v):
|
def lottery_active(v):
|
||||||
|
@ -52,7 +48,6 @@ def lottery_active(v):
|
||||||
return {"message": "", "stats": {"user": v.lottery_stats, "lottery": lottery, "participants": participants}}
|
return {"message": "", "stats": {"user": v.lottery_stats, "lottery": lottery, "participants": participants}}
|
||||||
|
|
||||||
@app.get("/admin/lottery/participants")
|
@app.get("/admin/lottery/participants")
|
||||||
@feature_required('GAMBLING')
|
|
||||||
@admin_level_required(PERMS['LOTTERY_VIEW_PARTICIPANTS'])
|
@admin_level_required(PERMS['LOTTERY_VIEW_PARTICIPANTS'])
|
||||||
def lottery_admin(v):
|
def lottery_admin(v):
|
||||||
participants = get_users_participating_in_lottery()
|
participants = get_users_participating_in_lottery()
|
||||||
|
|
Loading…
Reference in New Issue