Skip to main content

Asynchronous Python API for building Telegram bots

Project description

https://travis-ci.org/szastupov/aiotg.svg?branch=master

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


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 hashes)

Uploaded Source

Built Distribution

aiotg-0.5.1-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page