Skip to content

Commit

Permalink
fix: fixed type of inlab
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyreplus committed Nov 20, 2024
1 parent edd0e35 commit 8e4e521
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,17 @@ async def ore(update: Update, context: ContextTypes.DEFAULT_TYPE):
if response.status_code == 200:
data = response.json()
ore = round(float(data.get("ore")), 2)
inlab = str(data.get("inlab"))
inlab = data.get("inlab")
answer_text = ""
if ore is None:
await update.message.reply_text("Errore, contatta lo staff IT.\n Codice errore: in ore function: ore is None")
return
if inlab == "false":
if inlab is True:
answer_text = "Ciao! Non sei in lab 😿 \n"
elif inlab == "true":
elif inlab is False:
answer_text = "Ciao! Sei in lab 🐱\n"
else:
await update.message.reply_text("Errore, contatta lo staff IT.\n Codice errore: in ore function: inlab isn't true or false")
await update.message.reply_text(f"Errore, contatta lo staff IT.\n Codice errore: in ore function: inlab is {inlab}")
print(inlab)
return
reply_ore = answer_text + f"Mi risulta che finora tu abbia trascorso {ore} ore nel laboratorio di E-Agle TRT questo mese"
Expand Down

0 comments on commit 8e4e521

Please sign in to comment.