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 our 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.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distributions

aiotg-0.7.0.macosx-10.11-x86_64.tar.gz (9.3 kB view details)

Uploaded Source

aiotg-0.7.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aiotg-0.7.0.tar.gz
Algorithm Hash digest
SHA256 06b00dd77d83e6e15c86b6a2c68837e1dfe1feea07229f23bc2371a864b33e0c
MD5 c852b4a42a89ba3d7fa405183eb88f3c
BLAKE2b-256 68c959bbf6d7e5ac7bf3893e0c0b532d5d33ce9c77e1b86497a822b08ef46368

See more details on using hashes here.

Provenance

File details

Details for the file aiotg-0.7.0.macosx-10.11-x86_64.tar.gz.

File metadata

File hashes

Hashes for aiotg-0.7.0.macosx-10.11-x86_64.tar.gz
Algorithm Hash digest
SHA256 a08476096f589b078a991783901f385c52b05a8af22f8e96989b1157983b3b5e
MD5 656e37026e65676fa0252c1e97983863
BLAKE2b-256 7e14f9232057bd9a7dc3c3edc79569de5c0904427ed5d8f7ee0302104c6ec3e3

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for aiotg-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e0792e0f696bb74a95c81b848ed4bdb51c3f3c36a7a1dc6e312f30d14bc6df9b
MD5 27f6ade77bcd5a997ace72deb2e4dbb9
BLAKE2b-256 0c9114bcb2c8bdf2137798bacd6ea73fe378482f748c5c1c2859d13a003759fe

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