Skip to main content

Asynchronous Telegram Bot API

Project description

Asynchronous Telegram Bot

This project allows you to create asynchrounous Telegram Bots using Python 3.

At the moment the API is sparse, feel free to add more methods via Pull Requests or submit Issues.

Getting Started

  1. Get the source using git

    git clone

  2. Install using pip

    pip install atbot


import os
import asyncio
from atbot import TelegramBot, TelegramMessage, ChatAction

API_KEY = os.getenv('API_KEY')

async def handle_message(bot, msg):
    if msg.text == '/start':
        await bot.send_chat_action(, ChatAction.TYPING)
        await asyncio.sleep(0.2)
        await bot.send_message(, 'Hello, {0}!'.format(msg.sender.first_name))

async def my_bot():
    bot = TelegramBot(API_KEY)
    while True:
        updates = await bot.get_updates()
        for update in updates:
            obj = update.get_obj()
            if isinstance(obj, TelegramMessage):
                await handle_message(bot, obj)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for atbot, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size atbot-1.0.0.tar.gz (3.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page