Added comments to understand me as I edit

This commit is contained in:
Stefano Assenzo 2022-08-25 20:31:49 +02:00
parent 763f66d857
commit 41d0bc47bb
4 changed files with 8 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
game1.txt
game2.txt
game3.txt

View File

@ -1 +1 @@
Destiny 2: Bungie 30th Anniversary Pack
a

View File

@ -1 +1 @@
Ring of Pain
b

View File

@ -5,11 +5,13 @@ from win10toast import ToastNotifier
#Timeout before making a request to the API
import time
#Recheck for new games
def recheck_game():
#In 10 seconds I will double check if you have already redeemed the game.
time.sleep(10)
check_game()
#Send first game notification
def send_notification1():
print("Send first game notification")
#Icon file
@ -20,6 +22,7 @@ def send_notification1():
with open('game1.txt', 'w') as f:
f.write(current_games_title1)
#Send second game notification
def send_notification2():
print("Send second game notification")
#Icon file
@ -31,7 +34,7 @@ def send_notification2():
f.write(current_games_title2)
recheck_game()
#Check game and if there are new games send the notification
def check_game():
print("Connect to the api")
url = "https://api.plenusbot.xyz/epic_games?country=IT"
@ -57,5 +60,4 @@ def check_game():
else:
print("Send notification for second game")
send_notification2()
check_game()