From 52ab4dfbaf83d648d54c94fb01169f5810b96307 Mon Sep 17 00:00:00 2001 From: "Mike2.0" Date: Sun, 12 Nov 2023 17:12:34 +0000 Subject: [PATCH] Update main.py --- main.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 8334b2f..4c70bcd 100644 --- a/main.py +++ b/main.py @@ -124,8 +124,8 @@ async def mensaje_jueves(): async def horario(): try: user = bot.get_user(670695670486794260) - if time.localtime().tm_wday == 5: #aquí va el 0, no te olvides - await user.send("Buenos días, hoy es lunes, estas son las asignaturas que tienes hoy:") + if time.localtime().tm_wday == 6: #aquí va el 0, no te olvides + await user.send("Buenos días, hoy es lunes, estas son las asignaturas que tienes hoy: (días[1])") if time.localtime().tm_wday == 1: await user.send("Buenos días, hoy es martes, estas son las asignaturas que tienes hoy:") if time.localtime().tm_wday == 2: @@ -191,6 +191,19 @@ def parse_cmds(f): cmds.append((cmd, links)) + +def parse_horario(f): + horario_file = open(f) + for line in horario_file.readlines(): + if len(line.rstrip()) == 0: + continue + día = line.split(" ")[0] + asignaturas = [_ for _ in line.split()[1:]] + horario.append((día, asignaturas)) + + + + def make_help(): help = ("helpme", f"""El prefijo de este bot es: f! @@ -205,5 +218,6 @@ Disfrutad del bot if __name__ == '__main__': parse_cmds("cmds.txt") + parse_horario("horario.txt") make_help() bot.run(os.environ['TOKEN']) \ No newline at end of file