Skip to main content

JsonBot

Installation

pip install json-telegram-bot

Usage

from JSONTelegramBot import JsonBot

JsonBot("token", {
    "messages": {
        "/start": {"response": "hello *{first_name}*", "parse_mode": "MarkdownV2"},
        "/help": {"response": "Hello how can i help you"}
    }
}).run()

you can generate code to osonbot library itself (supports only osonbot library, and can not generate fully)

from JSONTelegramBot import JsonBot

JsonBot("token", {
    "messages": {
        "/start": {"response": "hello *{first_name}*", "parse_mode": "MarkdownV2"},
        "/help": {"response": "Hello how can i help you"}
    }
}).generate_code(library="osonbot", file="main.py")

Handling Inline Messages

from JSONTelegramBot import JsonBot

JsonBot("token", {
    "inline-messages": {
        "callback_data1": {"response": "you clicked the first inline button"},
        "callback_data2": {"response": "you clicked the sedond inline button"}
    }
}).run()

Send message to specific user by their Telegram ID

from JSONTelegramBot import JsonBot

JsonBot("token", {
    "messages": {
        "/start": {"response": "hello *{first_name}*", "parse_mode": "MarkdownV2"},
        "/send": {"id": 123456789, "response": "This is a message for a specific user"}
    }
}).run()

Done for now

Metadata

Release files for json-telegram-bot 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for json-telegram-bot 0.1.1
File Size Uploaded
json_telegram_bot-0.1.1.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for json-telegram-bot 0.1.1
File Interpreter ABI Platform
json_telegram_bot-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.8 kB

Release files / json_telegram_bot-0.1.1.tar.gz

Download URL json_telegram_bot-0.1.1.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5290959a4e109d145c84c59a92de0732cfbe543cc41c1e113d895cdcfa2dd01e
BLAKE2b-256 checksum
How to use checksums
3c03e370b14c48da4bbb1fc28ee40f7daa94e090439d55da26a81c87321578e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

Release files / json_telegram_bot-0.1.1-py3-none-any.whl

Download URL json_telegram_bot-0.1.1-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef9155e2426a7e2d4c2040d217371d99f0969f1621ac666f0e573d12ec11923b
BLAKE2b-256 checksum
How to use checksums
16b18a6294ca03432f6d47bf445afbe45504fd373db926ad7edb57a3df326b69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page