|
| def | __init__ (self, hass, bot, allowed_chat_ids, parser) |
| |
| def | answer_callback_query (self, message, callback_query_id, show_alert=False, context=None, **kwargs) |
| |
| def | delete_message (self, chat_id=None, context=None, **kwargs) |
| |
| def | edit_message (self, type_edit, chat_id=None, context=None, **kwargs) |
| |
| def | leave_chat (self, chat_id=None, context=None) |
| |
| def | send_file (self, file_type=SERVICE_SEND_PHOTO, target=None, context=None, **kwargs) |
| |
| def | send_location (self, latitude, longitude, target=None, context=None, **kwargs) |
| |
| def | send_message (self, message="", target=None, context=None, **kwargs) |
| |
| def | send_poll (self, question, options, is_anonymous, allows_multiple_answers, target=None, context=None, **kwargs) |
| |
| def | send_sticker (self, target=None, context=None, **kwargs) |
| |
|
| def | _get_msg_ids (self, msg_data, chat_id) |
| |
| def | _get_msg_kwargs (self, data) |
| |
| def | _get_target_chat_ids (self, target) |
| |
| def | _send_msg (self, func_send, msg_error, message_tag, *args_msg, context=None, **kwargs_msg) |
| |
Implement the notification services for the Telegram Bot domain.
Definition at line 500 of file __init__.py.
◆ __init__()
| def homeassistant.components.telegram_bot.TelegramNotificationService.__init__ |
( |
|
self, |
|
|
|
hass, |
|
|
|
bot, |
|
|
|
allowed_chat_ids, |
|
|
|
parser |
|
) |
| |
◆ _get_msg_ids()
| def homeassistant.components.telegram_bot.TelegramNotificationService._get_msg_ids |
( |
|
self, |
|
|
|
msg_data, |
|
|
|
chat_id |
|
) |
| |
|
private |
Get the message id to edit.
This can be one of (message_id, inline_message_id) from a msg dict,
returning a tuple.
**You can use 'last' as message_id** to edit
the message last sent in the chat_id.
Definition at line 518 of file __init__.py.
◆ _get_msg_kwargs()
| def homeassistant.components.telegram_bot.TelegramNotificationService._get_msg_kwargs |
( |
|
self, |
|
|
|
data |
|
) |
| |
|
private |
Get parameters in message data kwargs.
Definition at line 556 of file __init__.py.
◆ _get_target_chat_ids()
| def homeassistant.components.telegram_bot.TelegramNotificationService._get_target_chat_ids |
( |
|
self, |
|
|
|
target |
|
) |
| |
|
private |
Validate chat_id targets or return default target (first).
:param target: optional list of integers ([12234, -12345])
:return list of chat_id targets (integers)
Definition at line 539 of file __init__.py.
◆ _send_msg()
| def homeassistant.components.telegram_bot.TelegramNotificationService._send_msg |
( |
|
self, |
|
|
|
func_send, |
|
|
|
msg_error, |
|
|
|
message_tag, |
|
|
* |
args_msg, |
|
|
|
context = None, |
|
|
** |
kwargs_msg |
|
) |
| |
|
private |
◆ answer_callback_query()
| def homeassistant.components.telegram_bot.TelegramNotificationService.answer_callback_query |
( |
|
self, |
|
|
|
message, |
|
|
|
callback_query_id, |
|
|
|
show_alert = False, |
|
|
|
context = None, |
|
|
** |
kwargs |
|
) |
| |
Answer a callback originated with a press in an inline keyboard.
Definition at line 791 of file __init__.py.
◆ delete_message()
| def homeassistant.components.telegram_bot.TelegramNotificationService.delete_message |
( |
|
self, |
|
|
|
chat_id = None, |
|
|
|
context = None, |
|
|
** |
kwargs |
|
) |
| |
Delete a previously sent message.
Definition at line 715 of file __init__.py.
◆ edit_message()
| def homeassistant.components.telegram_bot.TelegramNotificationService.edit_message |
( |
|
self, |
|
|
|
type_edit, |
|
|
|
chat_id = None, |
|
|
|
context = None, |
|
|
** |
kwargs |
|
) |
| |
Edit a previously sent message.
Definition at line 734 of file __init__.py.
◆ leave_chat()
| def homeassistant.components.telegram_bot.TelegramNotificationService.leave_chat |
( |
|
self, |
|
|
|
chat_id = None, |
|
|
|
context = None |
|
) |
| |
◆ send_file()
| def homeassistant.components.telegram_bot.TelegramNotificationService.send_file |
( |
|
self, |
|
|
|
file_type = SERVICE_SEND_PHOTO, |
|
|
|
target = None, |
|
|
|
context = None, |
|
|
** |
kwargs |
|
) |
| |
Send a photo, sticker, video, or document.
Definition at line 813 of file __init__.py.
◆ send_location()
| def homeassistant.components.telegram_bot.TelegramNotificationService.send_location |
( |
|
self, |
|
|
|
latitude, |
|
|
|
longitude, |
|
|
|
target = None, |
|
|
|
context = None, |
|
|
** |
kwargs |
|
) |
| |
◆ send_message()
| def homeassistant.components.telegram_bot.TelegramNotificationService.send_message |
( |
|
self, |
|
|
|
message = "", |
|
|
|
target = None, |
|
|
|
context = None, |
|
|
** |
kwargs |
|
) |
| |
Send a message to one or multiple pre-allowed chat IDs.
Definition at line 692 of file __init__.py.
◆ send_poll()
| def homeassistant.components.telegram_bot.TelegramNotificationService.send_poll |
( |
|
self, |
|
|
|
question, |
|
|
|
options, |
|
|
|
is_anonymous, |
|
|
|
allows_multiple_answers, |
|
|
|
target = None, |
|
|
|
context = None, |
|
|
** |
kwargs |
|
) |
| |
◆ send_sticker()
| def homeassistant.components.telegram_bot.TelegramNotificationService.send_sticker |
( |
|
self, |
|
|
|
target = None, |
|
|
|
context = None, |
|
|
** |
kwargs |
|
) |
| |
Send a sticker from a telegram sticker pack.
Definition at line 936 of file __init__.py.
◆ _default_user
| homeassistant.components.telegram_bot.TelegramNotificationService._default_user |
|
private |
◆ _last_message_id
| homeassistant.components.telegram_bot.TelegramNotificationService._last_message_id |
|
private |
◆ _parse_mode
| homeassistant.components.telegram_bot.TelegramNotificationService._parse_mode |
|
private |
◆ _parsers
| homeassistant.components.telegram_bot.TelegramNotificationService._parsers |
|
private |
◆ allowed_chat_ids
| homeassistant.components.telegram_bot.TelegramNotificationService.allowed_chat_ids |
◆ bot
| homeassistant.components.telegram_bot.TelegramNotificationService.bot |
◆ hass
| homeassistant.components.telegram_bot.TelegramNotificationService.hass |
The documentation for this class was generated from the following file: