Skip to content

Commit

Permalink
Merge pull request #2 from enzomtpYT/Beta
Browse files Browse the repository at this point in the history
Fixed bugs
  • Loading branch information
enzomtpYT authored Apr 7, 2022
2 parents b4f940c + 41e4eb6 commit b23a534
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions Client.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Ver 0.2.7
# Ver 0.2.8
# Credits to enzomtp
from cmath import exp
import requests, json, os, datetime, discord
from ast import Try
from discord.ext import tasks

print("Python Pronote Bot V0.2.7 by enzomtp")
print("Python Pronote Bot V0.2.8 by enzomtp")

# Define all variables
preconf = open('./config.json')
Expand Down Expand Up @@ -149,11 +149,11 @@ async def on_ready():
# Schedule the daily Timetables task
@tasks.loop(time=datetime.time(hour=7, minute=0))
async def h24timetables():
print("Executing daily timetables")
global timechan
weekend = datetime.date.today()

for a in range(1,3):
print("Executing daily timetables")
global timechan
weekend = datetime.date.today()

timetab = json.loads(getTimetables(str(a)))
#Send timetables in the channel defined in config.json
timechan = bot.get_channel(int(config["group"][str(a)]["timetables"]))
Expand Down Expand Up @@ -208,12 +208,10 @@ async def h24timetables():
# Schedule the daily Homeworks task
@tasks.loop(time=datetime.time(hour=15, minute=15))
async def h24homeworks():
print("Executing daily homeworks")
global homechan


for a in range(1,3):
print(a)
print("Executing daily homeworks")
global homechan

home = json.loads(getHomeworks(str(a)))
#Send homeworks in the channel defined in config.json
weekendhome = datetime.date.today()+datetime.timedelta(days=1)
Expand Down

0 comments on commit b23a534

Please sign in to comment.