Update main.py

This commit is contained in:
Stefano Assenzo 2023-03-07 15:41:00 +01:00 committed by GitHub
parent c9e971c6bf
commit 0e77be9e07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -82,15 +82,17 @@ def send_notification():
for b in array_username: for b in array_username:
bot.send_message(b, i['School Subject'][tomorrow][0]['Subject'] + ", " + i['School Subject'][tomorrow][0]['Teacher'] + "\n" + i['School Subject'][tomorrow][1]['Subject'] + ", " + i['School Subject'][tomorrow][1]['Teacher'] + "\n" + i['School Subject'][tomorrow][2]['Subject'] + ", " + i['School Subject'][tomorrow][2]['Teacher'] + "\n" + i['School Subject'][tomorrow][3]['Subject'] + ", " + i['School Subject'][tomorrow][3]['Teacher'] + "\n" + i['School Subject'][tomorrow][4]['Subject'] + ", " + i['School Subject'][tomorrow][4]['Teacher'] + "\n" + i['School Subject'][tomorrow][5]['Subject'] + ", " + i['School Subject'][tomorrow][5]['Teacher']) bot.send_message(b, i['School Subject'][tomorrow][0]['Subject'] + ", " + i['School Subject'][tomorrow][0]['Teacher'] + "\n" + i['School Subject'][tomorrow][1]['Subject'] + ", " + i['School Subject'][tomorrow][1]['Teacher'] + "\n" + i['School Subject'][tomorrow][2]['Subject'] + ", " + i['School Subject'][tomorrow][2]['Teacher'] + "\n" + i['School Subject'][tomorrow][3]['Subject'] + ", " + i['School Subject'][tomorrow][3]['Teacher'] + "\n" + i['School Subject'][tomorrow][4]['Subject'] + ", " + i['School Subject'][tomorrow][4]['Teacher'] + "\n" + i['School Subject'][tomorrow][5]['Subject'] + ", " + i['School Subject'][tomorrow][5]['Teacher'])
schedule.every().day.at("06:50").do(send_notification)
schedule.every().day.at("07:50").do(send_notification) schedule.every().day.at("07:50").do(send_notification)
schedule.every().day.at("08:50").do(send_notification) schedule.every().day.at("08:50").do(send_notification)
schedule.every().day.at("09:50").do(send_notification) schedule.every().day.at("10:05").do(send_notification)
schedule.every().day.at("11:05").do(send_notification) schedule.every().day.at("11:05").do(send_notification)
schedule.every().day.at("12:05").do(send_notification) schedule.every().day.at("12:05").do(send_notification)
schedule.every().day.at("13:05").do(send_notification)
schedule.every().day.at("21:00").do(send_notification) schedule.every().day.at("21:00").do(send_notification)
now = datetime.datetime.now() now = datetime.datetime.now()
t1 = threading.Thread(target=bot.polling).start() t1 = threading.Thread(target=bot.polling).start()
while True: while True:
now = datetime.datetime.now()
print(now)
schedule.run_pending() schedule.run_pending()