Asynchronous Python API for building Telegram bots
Project description
Asynchronous Python API for building Telegram bots
Install it with pip:
pip install aiotg
Then you can create a new bot in few lines:
import os
from aiotg import TgBot
bot = TgBot(os.environ["API_TOKEN"])
@bot.command(r"/echo (.+)")
def echo(chat, match):
return chat.reply(match.group(1))
if __name__ == '__main__':
bot.run()
Run it with a proper API_TOKEN and it should reply to /echo commands.
For a more complete example, take a look at WhatisBot or Music Catalog Bot.
Have a question? Ask it on our Telegram chat.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aiotg-0.5.2.tar.gz
(4.0 kB
view details)
Built Distribution
aiotg-0.5.2-py3-none-any.whl
(5.6 kB
view details)
File details
Details for the file aiotg-0.5.2.tar.gz
.
File metadata
- Download URL: aiotg-0.5.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2e1c5a68aa5fcd510eab7cfbca73de19e894c41295590ff6417dcc4c08da5c9 |
|
MD5 | 9db3a1e5c576ce5575dfdde919b0b372 |
|
BLAKE2b-256 | 351698af262c6b7870b07da198e43901172204bf56ccdce8583a1d53f82e8912 |
Provenance
File details
Details for the file aiotg-0.5.2-py3-none-any.whl
.
File metadata
- Download URL: aiotg-0.5.2-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a836a3cdb29e85d0549083456019899ce451d8e2ae0013a4a828b6b98c0e5d9 |
|
MD5 | fd598c9015c523ec1774fb33644fdd93 |
|
BLAKE2b-256 | 1db97fb594796c8cf6fe90758b15f74a042d5c034b55010ba9a5b32f52389358 |