Skip to content

Commit 6e56fe5

Browse files
committed
Logging
1 parent c7fbe21 commit 6e56fe5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
quit(1)
5151

5252
def recaptcha(token):
53+
print(f"Verifying recaptcha {token[:15]}")
5354
recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify'
5455
payload = {
5556
'secret': config["recaptcha"]["private"],
@@ -61,12 +62,14 @@ def recaptcha(token):
6162
return result
6263

6364
def invite():
65+
print("Generating new invite!")
6466
resp = requests.post(
6567
'https://discordapp.com/api/channels/%s/invites' % config["discord"]["welcome_room"],
6668
headers={'Authorization': 'Bot %s' % config["discord"]["private"]},
6769
json={'max_uses': 1, 'unique': True, 'expires': 300}
6870
)
6971
i = resp.json()
72+
print("Generated new invite!")
7073
return i["code"]
7174

7275
app = Flask(__name__)
@@ -82,9 +85,11 @@ def index():
8285
if key: # if key set
8386
r = recaptcha(key) # confirm captcha
8487
if r["success"]: # if ok
88+
print(f"Recaptcha {key[:30]} verified!")
8589
i = invite() # generate new invite
8690
return redirect(f"https://discord.gg/{i}") # redirect user to new invite
8791
else: # if captcha invalid
92+
print(f"Recaptcha {key[:30]} failed!")
8893
return render_template("index.html", public=config["recaptcha"]["public"], failed=True, theme=theme, border=border, catpcha_theme=catpcha_theme) # return error page
8994
# if not key
9095
return render_template("index.html", public=config["recaptcha"]["public"], failed=False, theme=theme, border=border, catpcha_theme=catpcha_theme) # return normal page

0 commit comments

Comments
 (0)