Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5 from NorthernChicken/main
Browse files Browse the repository at this point in the history
add conditionals for certain error codes
  • Loading branch information
OddDevelopment authored Dec 22, 2023
2 parents 0981cf7 + 31dcbad commit f90933a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ def generate_random_string(length):
with open('codes.txt', 'a') as file:
file.write(f"https://discord.com/billing/partner-promotions/1180231712274387115/{token}\n")
print("Token saved to codes.txt file.")
elif response.status_code == 429:
print("Rate limit exceeded! Waiting one minute to allow for cooldown.")
time.sleep(60)
elif response.status_code == 504:
print("Server timed out! Trying again in 5 seconds.")
time.sleep(5)
else:
print(f"Request failed with status code {response.status_code}.")
print(f"Error message: {response.text}")
Expand Down

0 comments on commit f90933a

Please sign in to comment.