Asynchronous Python API for building Telegram bots
Project description
Asynchronous Python API for building Telegram bots, featuring:
Easy and declarative API
Hassle-free setup - no need for SSL certificates or static IP
Built-in support for analytics via botan.io
Automatic handling of Telegram API throttling or timeouts
Install it with pip:
pip install aiotg
Then you can create a new bot in few lines:
from aiotg import Bot
bot = Bot(api_token="...")
@bot.command(r"/echo (.+)")
def echo(chat, match):
return chat.reply(match.group(1))
bot.run()
Now 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 project’s 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.7.1.tar.gz
(5.0 kB
view hashes)
Built Distributions
aiotg-0.7.1-py3-none-any.whl
(6.1 kB
view hashes)
Close
Hashes for aiotg-0.7.1.macosx-10.11-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e169e0606dbae172b9edbc590f37fb1fb0cecbd521a36888760832b91e1c44ca |
|
MD5 | 272481c35beaee60e6fc20e670ab095b |
|
BLAKE2b-256 | 9f6b6282b7f05b8c443d6918fa1fea7c0b3f18ae4a795cc0d027c4670f31affb |