From a271ce9793d86d275a7a3abfc13f91e8b37adee4 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 8 Nov 2023 17:59:27 +1100 Subject: [PATCH] fix: Rate limit discord users --- gift.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gift.py b/gift.py index 7c9360e..bb5563b 100644 --- a/gift.py +++ b/gift.py @@ -66,6 +66,13 @@ def gift(name,email,referer, ip,api=False): if gift['ip'] == ip: return "You have already submitted a gift request" + if api: + for gift in gifts: + if gift['email'] == email: + return "You have already submitted a gift request" + if gift['name'] == name: + return "You have already submitted a gift request" + # Add the user to the list gifts.append({ 'name': name,