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.5.tar.gz
(26.9 kB
view hashes)
Built Distribution
Close
Hashes for telegram_botup-0.5.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30914b15c09aaac6f6eafb7bcacf0e0f27cd532bafa5a62c92c81f2fb6b3fff8 |
|
MD5 | 045529dc4da5d5c7f47cd33e01faa24b |
|
BLAKE2b-256 | e85dd3eab2b295463c15ec34b9d02636a52561102191b0f4bd75f63b16615046 |