Update main.py
This commit is contained in:
18
main.py
18
main.py
@@ -124,8 +124,8 @@ async def mensaje_jueves():
|
|||||||
async def horario():
|
async def horario():
|
||||||
try:
|
try:
|
||||||
user = bot.get_user(670695670486794260)
|
user = bot.get_user(670695670486794260)
|
||||||
if time.localtime().tm_wday == 5: #aquí va el 0, no te olvides
|
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:")
|
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:
|
if time.localtime().tm_wday == 1:
|
||||||
await user.send("Buenos días, hoy es martes, estas son las asignaturas que tienes hoy:")
|
await user.send("Buenos días, hoy es martes, estas son las asignaturas que tienes hoy:")
|
||||||
if time.localtime().tm_wday == 2:
|
if time.localtime().tm_wday == 2:
|
||||||
@@ -191,6 +191,19 @@ def parse_cmds(f):
|
|||||||
cmds.append((cmd, links))
|
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():
|
def make_help():
|
||||||
help = ("helpme", f"""El prefijo de este bot es: f!
|
help = ("helpme", f"""El prefijo de este bot es: f!
|
||||||
|
|
||||||
@@ -205,5 +218,6 @@ Disfrutad del bot
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
parse_cmds("cmds.txt")
|
parse_cmds("cmds.txt")
|
||||||
|
parse_horario("horario.txt")
|
||||||
make_help()
|
make_help()
|
||||||
bot.run(os.environ['TOKEN'])
|
bot.run(os.environ['TOKEN'])
|
||||||
Reference in New Issue
Block a user