sending meals in the correct language

Signed-off-by: Konrad <klux2@hs-mittweida.de>
This commit is contained in:
Konrad 2019-09-27 20:05:26 +02:00
parent 0bb014efec
commit c7c2f271ec

View file

@ -120,7 +120,11 @@ class HSMensaW(telepot.aio.helper.ChatHandler):
await send_message(bot_obj=bot, chat_id=chat_id,
msg="Für heute ist leider kein Speiseplan verfügbar.")
else:
await send_essen(chat_id)
if chat_id in ids.keys():
language = ids[chat_id]
else:
language = Language.GERMAN
await send_essen(chat_id, language)
await send_status("Essen versendet für Chat %s (ID: %i)" % (chat, chat_id))
elif text.startswith("/help"):
@ -363,7 +367,7 @@ async def essen_loop() -> None:
if len(essen) > 0:
await send_status("Essen werden gesendet")
for i in ids.keys():
await send_essen(i)
await send_essen(i, ids[i])
await send_status("Abgeschlossen, warte 30 Sekunden")
status = "Warte 30 Sekunden"
await asyncio.sleep(30)