feat: Add API only mode
All checks were successful
Build Docker / Build Image (push) Successful in 36s
All checks were successful
Build Docker / Build Image (push) Successful in 36s
This commit is contained in:
8
gift.py
8
gift.py
@@ -26,11 +26,19 @@ if os.getenv('max_gifts_per_interval') == 'true':
|
|||||||
if os.getenv('interval') == 'true':
|
if os.getenv('interval') == 'true':
|
||||||
interval = int(os.getenv('interval'))
|
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):
|
def gift(name,email,referer, ip,api=False):
|
||||||
global loaded
|
global loaded
|
||||||
global gifts
|
global gifts
|
||||||
global previous_gifts
|
global previous_gifts
|
||||||
|
|
||||||
|
|
||||||
|
if ONLY_API and not api:
|
||||||
|
return "Sorry, the faucet is currently only available through the Discord bot<br>Check back in a few minutes or contact Nathan.Woodburn/"
|
||||||
|
|
||||||
recent_gifts = 0
|
recent_gifts = 0
|
||||||
for gift in previous_gifts:
|
for gift in previous_gifts:
|
||||||
if gift['time'] > time.time() - interval:
|
if gift['time'] > time.time() - interval:
|
||||||
|
|||||||
Reference in New Issue
Block a user