Tiny asyncio-based telgram api wrapper library
Project description
Tiny asyncio-based telgram api wrapper library.
Reasons
aiotg is framework, not library and have no proxy support.
Raw api calls translation is better for understanding and will not break if telegram api will be changed.
snake_case
Features
Simple as telegram api is.
Based on aiohttp.
Proxy available (via aiohttp ProxyConnector).
snake_case api converted to telegram camelCase.
Polling offset handled for you via get_updates method.
Handling timeout between requests automatically (via pause keyword-only argument).
Source code is short and simple.
Installation
python -m pip install aiotelegram
Usage
Polling updates
import aiotelegram
async def ...(...):
api = aiotelegram.Api(token)
while True:
response = await api.get_updates()
if not response["ok"]:
...
else:
for update in response["result"]:
...
await asyncio.sleep(delay)
Sending message
async def ...(...):
await api.send_message(
chat_id=123456,
text="*foobar*",
parse_mode="Markdown",
)
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
File details
Details for the file aiotelegram-0.1.1.tar.gz
.
File metadata
- Download URL: aiotelegram-0.1.1.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e211db62224a3e6c2a37a782d3460c23214ddcf68b5dc7252af8a2cfc28b6db5 |
|
MD5 | e460de66a54c8f4da6ac7ddce1169702 |
|
BLAKE2b-256 | d52061eab45823c3a75b9c7888ca2b80512e48702afbaf38da50712d462ae88f |
File details
Details for the file aiotelegram-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: aiotelegram-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 286cad6170957307db4f6867a848b2e600e1aff6f6d3b7c6b6a731d500c122d7 |
|
MD5 | 1810dfff202a2de90c91226d254da56c |
|
BLAKE2b-256 | 0734608147eacc3708d4d8da337682d45029db297348ee495ca60bd4da097e67 |