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, 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


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.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

aiotg-0.7.3-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file aiotg-0.7.3.tar.gz.

File metadata

  • Download URL: aiotg-0.7.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for aiotg-0.7.3.tar.gz
Algorithm Hash digest
SHA256 0bbe371ca929ca37bea24fa81b4cd03cb90d1b7e860bf56208b60be4ea64952d
MD5 bde3871b6f538d16cc1624e3501fbe9c
BLAKE2b-256 712c7a4aa4cf1f273d5fa7bcb9b026a2e3658b34d24cedb7d598b1ae613a466f

See more details on using hashes here.

Provenance

File details

Details for the file aiotg-0.7.3-py3-none-any.whl.

File metadata

File hashes

Hashes for aiotg-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4e0055f6aa38a89aa568082002f9318f62249d212c3111c166ebdd8f5282840d
MD5 614ac32f75b6f2d0f1c4ef2e1c7f1a87
BLAKE2b-256 87e83ae4cdc68234032a2a3d3f7e23effd28de36e212c1aebfce575368db6e0d

See more details on using hashes here.

Provenance

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