sending meals in the correct language
Signed-off-by: Konrad <klux2@hs-mittweida.de>
This commit is contained in:
parent
0bb014efec
commit
c7c2f271ec
1 changed files with 6 additions and 2 deletions
|
@ -120,7 +120,11 @@ class HSMensaW(telepot.aio.helper.ChatHandler):
|
||||||
await send_message(bot_obj=bot, chat_id=chat_id,
|
await send_message(bot_obj=bot, chat_id=chat_id,
|
||||||
msg="Für heute ist leider kein Speiseplan verfügbar.")
|
msg="Für heute ist leider kein Speiseplan verfügbar.")
|
||||||
else:
|
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))
|
await send_status("Essen versendet für Chat %s (ID: %i)" % (chat, chat_id))
|
||||||
|
|
||||||
elif text.startswith("/help"):
|
elif text.startswith("/help"):
|
||||||
|
@ -363,7 +367,7 @@ async def essen_loop() -> None:
|
||||||
if len(essen) > 0:
|
if len(essen) > 0:
|
||||||
await send_status("Essen werden gesendet")
|
await send_status("Essen werden gesendet")
|
||||||
for i in ids.keys():
|
for i in ids.keys():
|
||||||
await send_essen(i)
|
await send_essen(i, ids[i])
|
||||||
await send_status("Abgeschlossen, warte 30 Sekunden")
|
await send_status("Abgeschlossen, warte 30 Sekunden")
|
||||||
status = "Warte 30 Sekunden"
|
status = "Warte 30 Sekunden"
|
||||||
await asyncio.sleep(30)
|
await asyncio.sleep(30)
|
||||||
|
|
Loading…
Reference in a new issue