mirror of
https://github.com/assenzostefano/notify-game-epicgames.git
synced 2025-02-02 00:47:03 +01:00
Fix msg
This commit is contained in:
parent
12636294dd
commit
276a85a8d1
31
index.py
31
index.py
@ -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")
|
Loading…
x
Reference in New Issue
Block a user