Simple and fast client to call rest-api endpoints `api.telegram.org` using `aiohttp` package.
Project description
Telegram Bot API - Python SDK (using aiohttp)
Simple and fast client to call rest-api endpoints api.telegram.org using aiohttp package.
View at: https://pypi.org/project/python-telegram-bot-api/
How to install
pip3 install python-telegram-bot-api
Usage
import asyncio
from api_tgbot import TgBotJson
TGBOT_TOKEN = "12345:YOUR_TOKEN"
APP_HOSTNAME = "https://YOUR_HOSTNAME.ngrok.io"
CHAT_ID = 123456789 # your chat id
client_tgbot = TgBotJson(token=TGBOT_TOKEN)
async def main_async():
response = await client_tgbot.setWebhook("{hostname}/tgbot/wh".format(hostname=APP_HOSTNAME))
r = await response.json()
print(r)
response = await client_tgbot.sendMessage(CHAT_ID, "Hello from Telegram Bot!")
r = await response.json()
print(r)
if __name__ == "__main__":
asyncio.run_until_complete(main_async())
Docs
- How to publish pypi package Medium article in Russian
Disclaimer
This project and its author is neither associated, nor affiliated with Telegram in anyway. See License section for more details.
License
This project is released under the GNU LESSER GENERAL PUBLIC LICENSE License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python-telegram-bot-api-0.0.3.tar.gz.
File metadata
- Download URL: python-telegram-bot-api-0.0.3.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.2.0 requests-toolbelt/0.8.0 tqdm/4.48.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07ca7a59f343913628207623e318d075a37abaa9b858eb8067533530e28fe5b3
|
|
| MD5 |
4de52fd8970fe19f82e23e17c9d9b217
|
|
| BLAKE2b-256 |
0a1f5c8189a3577a76a0f07d38ce7eb915243af70f6b20da05849dae5166d10c
|
File details
Details for the file python_telegram_bot_api-0.0.3-py3-none-any.whl.
File metadata
- Download URL: python_telegram_bot_api-0.0.3-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.2.0 requests-toolbelt/0.8.0 tqdm/4.48.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95a2c648897f527f13096bd24cd179de5a016d46c2e9993a8fa0f954ca472684
|
|
| MD5 |
5148027d0760d932facd75d67153ea5d
|
|
| BLAKE2b-256 |
6fcc17c9f0aac13b5703b27a75700f2999fcc04bb406c47a98131bbaac1e12ff
|