Skip to content

Commit

Permalink
feat: added in lab
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyreplus committed Nov 20, 2024
1 parent 33993ba commit 21d843c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,16 @@ 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 = round(float(data.get("inlab")), 2)
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
reply_ore = f"Mi risulta che finora tu abbia trascorso {ore} ore nel laboratorio di E-Agle TRT questo mese"
if inlab is None:
answer_text = "Ciao! Non sei in lab 😿 \n"
else:
answer_text = "Ciao! Sei in lab 🐱\n"
reply_ore = answer_text + "Mi risulta che finora tu abbia trascorso {ore} ore nel laboratorio di E-Agle TRT questo mese"
await update.message.reply_text(reply_ore)
else:
status_code = response.status_code
Expand Down

0 comments on commit 21d843c

Please sign in to comment.