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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
telegram-botup-0.5.2.tar.gz
(27.4 kB
view hashes)
Built Distribution
Close
Hashes for telegram_botup-0.5.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e11cf70c07b9c971ce9873e56dbf5b6bef961b4d7b63f6c536ba8bd6ca81010 |
|
MD5 | 9f162843a125cd7d07c1bc48a035e61c |
|
BLAKE2b-256 | 53e749351e63d8130aa531a4ad226b3019c907c9bc0d14bc7c2d44bbb7f8c374 |