telegrambotapiwrapper
Python Telegram Bot API wrapper
What is telegrambotapiwrapper?
telegramapiwrapper is the simplest Telegram Bot Api wrapper for Python among existing wrappers.
Requirements
Python 3.7
Installation
pip install telegrambotapiwrapper
Getting started.
Создание бота
Вы должны создать бота и получить токен
Testing your bot's auth token
Воспользуемся методом getMe
>>> from telegrambotapiwrapper.wrapper import Api
>>> bot_api = Api(token="<insert bot's auth token>")
>>> me = bot_api.get_me()
>>> print("me: {}".format(me)
me: User(id=123456789, is_bot=True, first_name='myrfffrbot', last_name=None, username='myrfffrbot', language_code=None)
>>> print("isinstance(me, User): {}".format(isinstance(me, User)))
isinstance(me, User): True
Sending text message
Sending audio file
Sending
Writing first bot
# firstbot.py
from telegrambotapiwrapper.wrapper import Api
from telegrambotapiwrapper.typelib import User
TOKEN = "<past_your_bot_api_token>"
bot_api = Api(token=TOKEN)
me = bot_api.get_me()
print("me: {}".format(me))
print("isinstance(me, User): {}".format(isinstance(me, User))) # see type of result
Result:
(venv) dzmitry@mycomp:~$ python3 firstbot.py
me: User(id=123456789, is_bot=True, first_name='myrfffrbot', last_name=None, username='myrfffrbot', language_code=None)
isinstance(me, User): True
(venv) dzmitry@mycomp:~$
Examples
Setting webhook
Sending message
Sending file
Using proxies
License
MIT License Copyright (c) 2019 Dzmitry Maliuzhenets
See LICENSE for details.
Release files for telegrambotapiwrapper 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| telegrambotapiwrapper-0.0.3.tar.gz | 29.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| telegrambotapiwrapper-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 64.3 kB
Release files / telegrambotapiwrapper-0.0.3.tar.gz
| Download URL | telegrambotapiwrapper-0.0.3.tar.gz |
|---|---|
| Size | 29.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e720f721c4f6a73e2e7295dd5f1c05f1f85e50142c20c36c4aa336542398e13f
|
|
BLAKE2b-256 checksum How to use checksums |
3b1a3b6e2aeb97ccca14c74b7548cc87743baa607a227906b6471bdebd853e23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2
|
Release files / telegrambotapiwrapper-0.0.3-py3-none-any.whl
| Download URL | telegrambotapiwrapper-0.0.3-py3-none-any.whl |
|---|---|
| Size | 35.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d879c1dd9948ee998c882f222712e5da1ba0c8f4112ea6e0df74a28754eb9c00
|
|
BLAKE2b-256 checksum How to use checksums |
ffe885a7015515b10c7e9d42637d18da2463cf523998ac432e722e8c1006285e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2
|