{"library":"pytelegrambotapi","title":"pyTelegramBotAPI","description":"pyTelegramBotAPI is a straightforward yet comprehensive Python library providing both synchronous and asynchronous implementations of the Telegram Bot API. It enables developers to easily create Telegram bots with features like message handling, inline queries, and custom keyboards. The library is actively maintained, with frequent updates (often monthly or bi-monthly) to support the latest Telegram Bot API versions, and the current version is 4.33.0.","language":"python","status":"active","last_verified":"Fri May 15","install":{"commands":["pip install pyTelegramBotAPI"],"cli":null},"imports":["import telebot\nbot = telebot.TeleBot(TOKEN)","from telebot.async_telebot import AsyncTeleBot\nbot = AsyncTeleBot(TOKEN)","from telebot import types"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nimport telebot\n\nAPI_TOKEN = os.environ.get('TELEGRAM_BOT_TOKEN', 'YOUR_BOT_TOKEN_HERE')\n\nif not API_TOKEN or API_TOKEN == 'YOUR_BOT_TOKEN_HERE':\n    print(\"Warning: TELEGRAM_BOT_TOKEN environment variable not set or placeholder used. \\n\"\\\n          \"Please obtain a token from @BotFather on Telegram and set it.\")\n    exit(1)\n\nbot = telebot.TeleBot(API_TOKEN)\n\n@bot.message_handler(commands=['start', 'help'])\ndef send_welcome(message):\n    bot.reply_to(message, \"Hi there, I am an EchoBot. I will echo your messages.\")\n\n@bot.message_handler(func=lambda message: True)\ndef echo_message(message):\n    bot.reply_to(message, message.text)\n\nprint(\"Bot started polling...\")\nbot.infinity_polling()","lang":"python","description":"This quickstart sets up a basic synchronous 'EchoBot' that replies to /start, /help, and any other text message by echoing the input. Ensure you replace 'YOUR_BOT_TOKEN_HERE' or set the `TELEGRAM_BOT_TOKEN` environment variable with the token obtained from @BotFather. The bot uses `infinity_polling()` to continuously check for new messages.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-15","installed_version":"4.32.0","pypi_latest":"4.33.0","is_stale":true,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":2.4,"avg_import_s":0.73,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pyTelegramBotAPI","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.69,"mem_mb":13.7,"disk_size":"24.9M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pyTelegramBotAPI","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.4,"import_time_s":0.5,"mem_mb":13.7,"disk_size":"25M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyTelegramBotAPI","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":1,"mem_mb":15.4,"disk_size":"27.5M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pyTelegramBotAPI","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.4,"import_time_s":0.82,"mem_mb":15.4,"disk_size":"28M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pyTelegramBotAPI","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.84,"mem_mb":15.1,"disk_size":"19.2M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pyTelegramBotAPI","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.1,"import_time_s":0.83,"mem_mb":15.1,"disk_size":"20M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pyTelegramBotAPI","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.76,"mem_mb":16,"disk_size":"18.9M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pyTelegramBotAPI","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.2,"import_time_s":0.79,"mem_mb":15.9,"disk_size":"19M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pyTelegramBotAPI","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.62,"mem_mb":13.4,"disk_size":"24.1M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pyTelegramBotAPI","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.8,"import_time_s":0.5,"mem_mb":13.4,"disk_size":"25M"}]}}