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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aiotg

Asynchronous Python API for building Telegram bots

This module is under heavy development, so it's not on PyPI yet. The current recommended way to use it is as GIT submodule:

git submodule add https://github.com/szastupov/aiotg.git
pip install -r ./aiotg/requirements.txt

You can create a new bot in a few lines:

import os
from aiotg import TgBot

bot = TgBot(os.environ["API_TOKEN"])

@bot.command(r"/echo (.+)")
def echo(message, match):
    return message.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.

About

Asynchronous Python framework for building Telegram bots

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%