Registry / communication / telebot

telebot

JSON →
library0.0.5pypiunverified

This `telebot` library (version 0.0.5) by KyleJamesWalker is a minimalist Telegram bot library featuring simple route decorators for message handling. It was last updated in 2018 and appears to be abandoned, meaning it might not be compatible with the latest Telegram API changes and could have unaddressed issues. Crucially, it shares a package name with the significantly more popular and actively maintained `pyTelegramBotAPI` library, leading to frequent user confusion.

pip install telebot
INSTALL
IMPORT
SIG · TELEBOT
T
telebot
communicationenv0.0.5
Install
3.1s avg
Import
—
Disk
31MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.0.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 33.5MB
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 3.1s · import 0.000s · 36MB
31MB installed
● package 31MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

bot
✓ from telebot import bot
✗ from telebot import TeleBot
This `telebot` package by KyleJamesWalker is distinct from the more popular `pyTelegramBotAPI` which typically uses `TeleBot` as its primary class.
handle_message
✓ from telebot import handle_message
✗ from telebot.ext import MessageHandler
This `handle_message` decorator is specific to the KyleJamesWalker/telebot library's routing mechanism, not to other Telegram bot libraries.

This quickstart demonstrates how to initialize the bot, define command handlers using decorators, and start the polling loop for the `KyleJamesWalker/telebot` library. Ensure you have a valid Telegram Bot Token from BotFather, ideally passed via an environment variable.

import os from telebot import bot, handle_message # This token should be obtained from BotFather on Telegram. # For local testing, you can hardcode it, but for deployment use environment variables. BOT_TOKEN = os.environ.get('TELEBOT_TOKEN', 'YOUR_BOT_TOKEN_HERE') # Initialize the bot my_bot = bot(BOT_TOKEN) @handle_message("/start") def start_command(message): my_bot.post_message(message["chat"]["id"], "Hello! I am your simple bot.") @handle_message("/hello") def hello_command(message): my_bot.post_message(message["chat"]["id"], "Hi there!") @handle_message("default") # This acts as a fallback for any other message def default_message(message): my_bot.post_message(message["chat"]["id"], "I received: " + message["text"]) if __name__ == "__main__": if BOT_TOKEN == 'YOUR_BOT_TOKEN_HERE': print("WARNING: Please replace 'YOUR_BOT_TOKEN_HERE' with your actual bot token or set the TELEBOT_TOKEN environment variable.") print("Starting KyleJamesWalker/telebot (version 0.0.5). Press Ctrl+C to stop.") print("Using token ending in:", BOT_TOKEN[-4:]) # The run() method starts an infinite loop for polling my_bot.run()
Debug
Known issues
breakingCritical Name Collision with `pyTelegramBotAPI`
fix
This `telebot` package (KyleJamesWalker/telebot) is distinct from the more popular `pyTelegramBotAPI` (which is also imported as `telebot`). If you intended to use `pyTelegramBotAPI`, ensure you `pip install pyTelegramBotAPI` and use its corresponding API (e.g., `from telebot import TeleBot`). Do not mix code from both libraries, as they are incompatible.
affects: All versions (0.0.1-0.0.5)
deprecatedLibrary is Abandoned and Potentially Outdated
fix
This library has not been updated since 2018. It may not be compatible with current Telegram API changes, have unpatched security vulnerabilities, or contain bugs. Consider using a more actively maintained library like `pyTelegramBotAPI` or `python-telegram-bot` for robust applications.
affects: All versions (0.0.1-0.0.5)
gotchaBasic Error Handling and Features
fix
The library is minimalist and lacks many advanced features (e.g., file uploads, inline queries, webhook support, sophisticated error handling) that are common in more mature Telegram bot libraries. For advanced use cases, you may need to implement them manually or choose a more feature-rich library.
affects: All versions (0.0.1-0.0.5)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'telebot.TeleBot'
You installed `KyleJamesWalker/telebot` but are trying to use API calls (like `TeleBot` class) from the `pyTelegramBotAPI` library.
fix
If you intended to use `pyTelegramBotAPI`, run `pip uninstall telebot` and then `pip install pyTelegramBotAPI`. If you intended to use `KyleJamesWalker/telebot`, use `from telebot import bot` and `my_bot = bot(TOKEN)` instead.
AttributeError: 'TeleBot' object has no attribute 'handle_message'
You installed `pyTelegramBotAPI` but are trying to use the decorator-based routing (`@handle_message`) specific to the `KyleJamesWalker/telebot` library.
fix
If you intended to use `KyleJamesWalker/telebot`, run `pip uninstall pyTelegramBotAPI` and then `pip install telebot`. If you intended to use `pyTelegramBotAPI`, use its `bot.message_handler(commands=['start'])` decorator or similar methods instead of `@handle_message`.
TypeError: 'module' object is not callable
You have installed `KyleJamesWalker/telebot`, and its `bot` is a module, not a callable class named `TeleBot`.
fix
If you intended to use `KyleJamesWalker/telebot`, initialize it with `from telebot import bot; my_bot = bot(TOKEN)`. If you intended to use `pyTelegramBotAPI`, ensure it's installed (`pip install pyTelegramBotAPI`) and use `from telebot import TeleBot; my_bot = TeleBot(TOKEN)`.
Upgrade
Version history
0.0.5latest on PyPI · released Feb 14, 2023
Audit
Dependencies
requestsrequiredUsed for making HTTP requests to the Telegram API. Mentioned in release notes for v0.0.4.
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources

No resource links recorded.

telebot — pip install telebot · libregistry