telegram_platform#
- class besser.bot.platforms.telegram.telegram_platform.TelegramPlatform(bot)[source]#
Bases:
Platform
The Telegram Platform allows a bot 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 bot session.
- Parameters:
bot (Bot) – the bot the platform belongs to
- _telegram_app#
The Telegram Application
- Type:
Application
- _event_loop#
The event loop that runs the asynchronous tasks of the Telegram Application
- _abc_impl = <_abc._abc_data object>#
- add_handler(handler)[source]#
Add a custom Telegram handler for the 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.