requiring user to start the bot to change the language now

Signed-off-by: Konrad <klux2@hs-mittweida.de>
This commit is contained in:
Konrad 2019-09-27 20:51:34 +02:00
parent 2fd4dab43f
commit 83adbc9808

View file

@ -3,7 +3,6 @@
import asyncio
import datetime
import json
import locale
import signal
import sys
import traceback
@ -129,10 +128,13 @@ class HSMensaW(telepot.aio.helper.ChatHandler):
await send_message(bot_obj=bot, chat_id=chat_id, msg=info_str, parse_mode="markdown")
elif text.startswith("/settings"):
await send_message(bot_obj=bot, chat_id=chat_id,
msg="Bitte Sprache(n) auswählen/Please select language(s)",
reply_markup=self.keyboard)
if chat_id in ids:
await send_message(bot_obj=bot, chat_id=chat_id,
msg="Bitte Sprache(n) auswählen/Please select language(s)",
reply_markup=self.keyboard)
else:
await send_message(bot_obj=bot, chat_id=chat_id,
msg="Bitte starten Sie zuerst den Bot/Please start the bot first.\n/start")
elif text.startswith("/status") and chat_id in config_ids:
await send_message(bot_obj=bot, chat_id=chat_id, msg=status, parse_mode="markdown")
@ -376,13 +378,13 @@ def process_json(d):
return d
sys.stdout = open("out.log", "a")
sys.stderr = open("err.log", "a")
# sys.stdout = open("out.log", "a")
# sys.stderr = open("err.log", "a")
message_log = open("msg.log", "a")
signal.signal(signal.SIGTERM, shutdown)
signal.signal(signal.SIGINT, shutdown)
locale.setlocale(locale.LC_TIME, 'de_DE.UTF-8')
#locale.setlocale(locale.LC_TIME, 'de_DE.UTF-8')
translator = Translator()