Skip to main content

Library for development Telegram bots

Project description

Telegram-botup

The library has several utilities for creating telegram bots:

  • Dispatcher handles incoming updates
  • Sender implements Telegram API methods
  • Other utils, types and etc

Installation

$ pip install telegram-botup

Example

from flask import Flask, request
from botup import Dispatcher, Sender

TOKEN = "token"

flask_app = Flask(__name__)
dispatcher = Dispatcher()
sender = Sender(TOKEN)


@dispatcher.message_handler('hello')
def hello_handler(chat_id, update):
    sender.send_message(chat_id, f'Hello {update.message.from_.first_name}')


@flask_app.route(f'/{TOKEN}', methods=['POST'])
def index():
    dispatcher.handle(request.get_json())
    return "!", 200

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 telegram-botup, version 0.5.2
Filename, size File type Python version Upload date Hashes
Filename, size telegram_botup-0.5.2-py3-none-any.whl (30.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size telegram-botup-0.5.2.tar.gz (27.4 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