diff --git a/litecord/ratelimits/main.py b/litecord/ratelimits/main.py new file mode 100644 index 0000000..4ab71d6 --- /dev/null +++ b/litecord/ratelimits/main.py @@ -0,0 +1,5 @@ +from quart import current_app as app, request + +async def ratelimit_handler(): + # dummy handler for future code + print(request.headers) diff --git a/run.py b/run.py index 6f9f748..195aa0c 100644 --- a/run.py +++ b/run.py @@ -15,6 +15,8 @@ from litecord.blueprints import ( voice, invites, relationships, dms ) +from litecord.ratelimits.main import ratelimit_handler + # those blueprints are separated from the "main" ones # for code readability if people want to dig through # the codebase. @@ -87,6 +89,11 @@ for bp, suffix in bps.items(): app.register_blueprint(bp, url_prefix=f'/api/v6{suffix}') +@app.before_request +async def app_before_request(): + await ratelimit_handler() + + @app.after_request async def app_after_request(resp): origin = request.headers.get('Origin', '*')