This commit is contained in:
Stefano Assenzo 2022-08-24 18:59:45 +02:00
parent 12636294dd
commit 276a85a8d1
3 changed files with 27 additions and 6 deletions

1
game1.txt Normal file
View File

@ -0,0 +1 @@
DOOM 64

1
game2.txt Normal file
View File

@ -0,0 +1 @@
Rumbleverse - Boom Boxer Content Pack

View File

@ -7,10 +7,29 @@ from win10toast import ToastNotifier
url = "https://api.plenusbot.xyz/epic_games?country=IT"
response = requests.get(url).json()
# Title of current games
current_games_title = response['currentGames'][0]['title']
current_games_title1 = response['currentGames'][0]['title']
current_games_title2 = response['currentGames'][1]['title']
fix_1 = "["+"'"+current_games_title1+"'""]"
fix_2 = "["+"'"+current_games_title2+"'""]"
#Icon file
filename = 'epic_games.ico'
#Create notification on Windows
toast = ToastNotifier()
toast.show_toast(title="New games!", msg="There is a new game on Epic Games Store " + current_games_title , icon_path=filename,duration=10,threaded=False)
#Generate Windows notification
def notification():
#Icon file
filename = 'epic_games.ico'
#Create notification on Windows
toast = ToastNotifier()
toast.show_toast(title="New games!", msg="The new game is: " + current_games_title1 , icon_path=filename,duration=10,threaded=False)
#Check if i already redeem the game
with open('game1.txt') as f:
lines = f.readlines()
if fix_1 == lines:
notification()
else:
print("Nope")
with open('game2.txt') as f:
lines = f.readlines()
if fix_2 == lines:
notification()
else:
print("Nope")