Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bugs #2

Merged
merged 2 commits into from
Apr 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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