Update main.py

This commit is contained in:
Mike2.0
2023-11-12 17:12:34 +00:00
parent 114b2f1ccc
commit 52ab4dfbaf

18
main.py
View File

@@ -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'])