Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions homeassistant/components/telegram_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
SERVICE_DELETE_MESSAGE = "delete_message"
SERVICE_LEAVE_CHAT = "leave_chat"

EVENT_TELEGRAM_SENT = "telegram_sent"
EVENT_TELEGRAM_CALLBACK = "telegram_callback"
EVENT_TELEGRAM_COMMAND = "telegram_command"
EVENT_TELEGRAM_TEXT = "telegram_text"
Expand Down Expand Up @@ -541,6 +542,10 @@ def _send_msg(self, func_send, msg_error, *args_msg, **kwargs_msg):
if not isinstance(out, bool) and hasattr(out, ATTR_MESSAGEID):
chat_id = out.chat_id
self._last_message_id[chat_id] = out[ATTR_MESSAGEID]

# Fire event of telegram_sent
self.hass.bus.async_fire(EVENT_TELEGRAM_SENT, out.to_dict())

_LOGGER.debug(
"Last message ID: %s (from chat_id %s)",
self._last_message_id,
Expand Down