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 asyncio
import datetime import datetime
import json import json
import locale
import signal import signal
import sys import sys
import traceback 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") await send_message(bot_obj=bot, chat_id=chat_id, msg=info_str, parse_mode="markdown")
elif text.startswith("/settings"): elif text.startswith("/settings"):
if chat_id in ids:
await send_message(bot_obj=bot, chat_id=chat_id, await send_message(bot_obj=bot, chat_id=chat_id,
msg="Bitte Sprache(n) auswählen/Please select language(s)", msg="Bitte Sprache(n) auswählen/Please select language(s)",
reply_markup=self.keyboard) 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: 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") 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 return d
sys.stdout = open("out.log", "a") # sys.stdout = open("out.log", "a")
sys.stderr = open("err.log", "a") # sys.stderr = open("err.log", "a")
message_log = open("msg.log", "a") message_log = open("msg.log", "a")
signal.signal(signal.SIGTERM, shutdown) signal.signal(signal.SIGTERM, shutdown)
signal.signal(signal.SIGINT, 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() translator = Translator()