From f4d937ff0f1597ca37cd8f057c7ac6b16dce5d68 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sat, 5 Apr 2025 14:51:12 +1100 Subject: [PATCH] feat: Add API only mode --- gift.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gift.py b/gift.py index 1d5450c..7b78664 100644 --- a/gift.py +++ b/gift.py @@ -26,11 +26,19 @@ if os.getenv('max_gifts_per_interval') == 'true': if os.getenv('interval') == 'true': interval = int(os.getenv('interval')) +ONLY_API = False +if os.getenv("ONLY_API") == 'true': + ONLY_API = True + def gift(name,email,referer, ip,api=False): global loaded global gifts global previous_gifts + + if ONLY_API and not api: + return "Sorry, the faucet is currently only available through the Discord bot
Check back in a few minutes or contact Nathan.Woodburn/" + recent_gifts = 0 for gift in previous_gifts: if gift['time'] > time.time() - interval: