From 6e56fe58c8b4fa5ece986ee4a7b480bcd0b29a5c Mon Sep 17 00:00:00 2001 From: MiranDaniel Date: Sat, 20 Nov 2021 16:26:00 +0100 Subject: [PATCH] Logging --- app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.py b/app.py index a7cf7d0..1e55233 100644 --- a/app.py +++ b/app.py @@ -50,6 +50,7 @@ quit(1) def recaptcha(token): + print(f"Verifying recaptcha {token[:15]}") recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify' payload = { 'secret': config["recaptcha"]["private"], @@ -61,12 +62,14 @@ def recaptcha(token): return result def invite(): + print("Generating new invite!") resp = requests.post( 'https://discordapp.com/api/channels/%s/invites' % config["discord"]["welcome_room"], headers={'Authorization': 'Bot %s' % config["discord"]["private"]}, json={'max_uses': 1, 'unique': True, 'expires': 300} ) i = resp.json() + print("Generated new invite!") return i["code"] app = Flask(__name__) @@ -82,9 +85,11 @@ def index(): if key: # if key set r = recaptcha(key) # confirm captcha if r["success"]: # if ok + print(f"Recaptcha {key[:30]} verified!") i = invite() # generate new invite return redirect(f"https://discord.gg/{i}") # redirect user to new invite else: # if captcha invalid + print(f"Recaptcha {key[:30]} failed!") return render_template("index.html", public=config["recaptcha"]["public"], failed=True, theme=theme, border=border, catpcha_theme=catpcha_theme) # return error page # if not key return render_template("index.html", public=config["recaptcha"]["public"], failed=False, theme=theme, border=border, catpcha_theme=catpcha_theme) # return normal page