Skip to content
forked from szastupov/aiotg

Asynchronous Python framework for building Telegram bots

License

Notifications You must be signed in to change notification settings

MiauWuffMiau/aiotg

 
 

Repository files navigation

aiotg

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:

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

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.

About

Asynchronous Python framework for building Telegram bots

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%