1
0
Fork 0

The real other fix, not a .gitignore who want to commit alone

This commit is contained in:
Ethanell 2019-09-20 08:16:58 +02:00
parent 9c3c0bf4d5
commit b98654a09e
2 changed files with 3 additions and 3 deletions

View file

@ -38,7 +38,7 @@ class User:
res = None
if self.kfet:
cmds = requests.get(KFET_URL).json()
if str(self.kfet) in cmds:
if cmds and str(self.kfet) in cmds:
res = 1 if cmds[str(self.kfet)]["statut"] == "T" else 2
elif get_now().hour >= 14:
res = 3

4
bot.py
View file

@ -34,7 +34,7 @@ logging.basicConfig(
if not isfile("token.ini"):
logger.critical("No token specified, impossible to start the bot !")
exit(1)
API_TOKEN = open("token.ini").read()
API_TOKEN = open("token.ini").readline().replace("\n", "")
ADMIN_ID = 148441652
TIMES = ["", "day", "next", "week", "next week"]
@ -66,7 +66,7 @@ async def notif():
nt = db[u].get_notif()
kf = db[u].get_kfet()
if nt:
await bot.send_message(int(u), lang(db[u], "notif_event")+nt, parse_mode=ParseMode.MARKDOWN)
await bot.send_message(int(u), lang(db[u], "notif_event")+str(nt), parse_mode=ParseMode.MARKDOWN)
if kf is not None:
if kf == 1:
kf = lang(db[u], "kfet")