Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.telegram_bot.BaseTelegramBotEntity Class Reference

Public Member Functions

def __init__ (self, hass, config)
 
bool authorize_update (self, Update update)
 
bool handle_update (self, Update update, CallbackContext context)
 

Public Attributes

 allowed_chat_ids
 
 hass
 

Private Member Functions

tuple[str, dict[str, Any]] _get_callback_query_event_data (self, CallbackQuery callback_query)
 
tuple[str, dict[str, Any]] _get_message_event_data (self, Message message)
 
dict[str, Any] _get_user_event_data (self, User user)
 

Static Private Member Functions

dict[str, str|list] _get_command_event_data (str|None command_text)
 

Detailed Description

The base class for the telegram bot.

Definition at line 1024 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

def homeassistant.components.telegram_bot.BaseTelegramBotEntity.__init__ (   self,
  hass,
  config 
)
Initialize the bot base class.

Definition at line 1027 of file __init__.py.

Member Function Documentation

◆ _get_callback_query_event_data()

tuple[str, dict[str, Any]] homeassistant.components.telegram_bot.BaseTelegramBotEntity._get_callback_query_event_data (   self,
CallbackQuery   callback_query 
)
private

Definition at line 1094 of file __init__.py.

◆ _get_command_event_data()

dict[str, str | list] homeassistant.components.telegram_bot.BaseTelegramBotEntity._get_command_event_data ( str | None  command_text)
staticprivate

Definition at line 1060 of file __init__.py.

◆ _get_message_event_data()

tuple[str, dict[str, Any]] homeassistant.components.telegram_bot.BaseTelegramBotEntity._get_message_event_data (   self,
Message  message 
)
private

Definition at line 1068 of file __init__.py.

◆ _get_user_event_data()

dict[str, Any] homeassistant.components.telegram_bot.BaseTelegramBotEntity._get_user_event_data (   self,
User  user 
)
private

Definition at line 1087 of file __init__.py.

◆ authorize_update()

bool homeassistant.components.telegram_bot.BaseTelegramBotEntity.authorize_update (   self,
Update  update 
)
Make sure either user or chat is in allowed_chat_ids.

Definition at line 1117 of file __init__.py.

◆ handle_update()

bool homeassistant.components.telegram_bot.BaseTelegramBotEntity.handle_update (   self,
Update  update,
CallbackContext  context 
)
Handle updates from bot application set up by the respective platform.

Definition at line 1032 of file __init__.py.

Member Data Documentation

◆ allowed_chat_ids

homeassistant.components.telegram_bot.BaseTelegramBotEntity.allowed_chat_ids

Definition at line 1029 of file __init__.py.

◆ hass

homeassistant.components.telegram_bot.BaseTelegramBotEntity.hass

Definition at line 1030 of file __init__.py.


The documentation for this class was generated from the following file: