telegram_platform#
- class besser.agent.platforms.telegram.telegram_platform.TelegramPlatform(agent)[source]#
Bases:
Platform
The Telegram Platform allows an agent to interact via Telegram.
It includes a message handler to handle all text inputs except commands (i.e. messages starting with ‘/’), voice, file and image handlers and a reset handler, triggered by the /reset command, to reset the agent session.
- Parameters:
agent (Agent) – the agent the platform belongs to
- _telegram_app#
The Telegram Application
- Type:
- _event_loop#
The event loop that runs the asynchronous tasks of the Telegram Application
- _handlers#
List of telegram bot handlers
- Type:
- _abc_impl = <_abc._abc_data object>#
- add_handler(handler)[source]#
Add a custom Telegram handler for the Telegram bot.
- Parameters:
handler (telegram.ext.BaseHandler) – the handler to add
- initialize()[source]#
Initialize the platform. This function is called right before starting the platform.
- property telegram_app#
The Telegram app.