Asynchronous Python API for building Telegram bots
Project description
Asynchronous Python API for building Telegram bots
This module is under heavy development, so the API is not stable yet, but you are encouraged to play with it and report any issues and suggestions.
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.
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.1.tar.gz
(4.0 kB
view details)
Built Distribution
aiotg-0.5.1-py3-none-any.whl
(5.6 kB
view details)
File details
Details for the file aiotg-0.5.1.tar.gz
.
File metadata
- Download URL: aiotg-0.5.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da35d2df2b35f1f19786eb1a6577ab627a318acd750c058c70bcf0d46aa8b903 |
|
MD5 | 4d0b70535012bda4242fa9ada458dbd5 |
|
BLAKE2b-256 | 0597020e2a1487f1c67db8dcb94afd525c25552949e2e2a4b3fc17ceed14b55e |
Provenance
File details
Details for the file aiotg-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: aiotg-0.5.1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 739a02c2ba6df517c5b5f6108b6b28f398f15c04021613d8ef8411e9a367b8b4 |
|
MD5 | c2f4cffa92facbbca1ca075a9d2f136e |
|
BLAKE2b-256 | 49a0f3bc2499043d32de914e10726e6145485d495b54ca5d892ff027d38ce555 |