Include telegram_bot message id for all messages (#29315)

* Include telegram_bot message id for all messages

* Update __init__.py
This commit is contained in:
Luca Angemi
2019-12-03 21:51:45 +01:00
committed by Paulus Schoutsen
parent 25b6740466
commit cae802f7ee

View File

@@ -731,6 +731,8 @@ class BaseTelegramBotEntity:
ATTR_USER_ID: msg_data["from"]["id"], ATTR_USER_ID: msg_data["from"]["id"],
ATTR_FROM_FIRST: msg_data["from"]["first_name"], ATTR_FROM_FIRST: msg_data["from"]["first_name"],
} }
if "message_id" in msg_data:
data[ATTR_MSGID] = msg_data["message_id"]
if "last_name" in msg_data["from"]: if "last_name" in msg_data["from"]:
data[ATTR_FROM_LAST] = msg_data["from"]["last_name"] data[ATTR_FROM_LAST] = msg_data["from"]["last_name"]
if "chat" in msg_data: if "chat" in msg_data:
@@ -752,6 +754,9 @@ class BaseTelegramBotEntity:
if event_data is None: if event_data is None:
return message_ok return message_ok
if ATTR_MSGID in data:
event_data[ATTR_MSGID] = data[ATTR_MSGID]
if "text" in data: if "text" in data:
if data["text"][0] == "/": if data["text"][0] == "/":
pieces = data["text"].split(" ") pieces = data["text"].split(" ")