referencing to user by its id
Signed-off-by: klux2 <k.lux.gm@gmail.com>
This commit is contained in:
parent
337d4d15f8
commit
cb8d23e4f5
1 changed files with 6 additions and 6 deletions
|
@ -181,14 +181,14 @@ class HSMensaW(telepot.aio.helper.ChatHandler):
|
||||||
chat_id = int(query_data[query_data.index("::") + 2:])
|
chat_id = int(query_data[query_data.index("::") + 2:])
|
||||||
|
|
||||||
name = ""
|
name = ""
|
||||||
|
user_id = msg["from"]["id"]
|
||||||
if "first_name" in msg["from"].keys():
|
if "first_name" in msg["from"].keys():
|
||||||
name = msg["from"]["first_name"] + " "
|
name = msg["from"]["first_name"] + " "
|
||||||
if "last_name" in msg["from"].keys():
|
if "last_name" in msg["from"].keys():
|
||||||
name += msg["from"]["last_name"]
|
name += msg["from"]["last_name"]
|
||||||
if len(name) > 0:
|
if len(name) == 0:
|
||||||
msg = name + " hat die Sprache geändert nach "
|
name = "User " + user_id
|
||||||
else:
|
msg = "[" + name + "](tg://user?id=" + str(user_id) + ") hat die Sprache geändert nach "
|
||||||
msg = "Sprache geändert nach "
|
|
||||||
|
|
||||||
message = "Fehler beim Setzen der Sprache"
|
message = "Fehler beim Setzen der Sprache"
|
||||||
if lang == Language.GERMAN.value:
|
if lang == Language.GERMAN.value:
|
||||||
|
@ -407,8 +407,8 @@ 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)
|
||||||
|
|
Loading…
Reference in a new issue