Version 2.3.3 (stable)
Native python package witch pure Python interface for the Telegram Bot API.
The code is generated directly from the API documentation, meaning up-to-date code is a matter of minutes.
- Official API changes of
Bot API 2
.3
.1
(December 4, 2016) - Older changes...
python setup.py install
from pytgbot import Bot
bot = Bot(API_KEY)
# sending messages:
bot.send_message(CHAT, "Example Text!") # CHAT can be a @username or a id
# getting events:
for x in bot.get_updates():
print(x)
All the functions can be found in the Bot
class in the pytgbot/bot.py file.
They are pythonic in small letters with underscores instead of camel case, for example getUpdates is bot.get_updates
Have a look into the examples folder.
First you should set logging to level DEBUG
to see what's going on.
# add this to the first lines in your file
import logging
logging.basicConfig(level=logging.DEBUG)
If you are about to open a new issue, search the existing ones (open and closed) first. Sometimes they are already reported or even solved.