Metadata-Version: 2.4
Name: json-telegram-bot
Version: 0.1.2
Summary: Build Telegram bots from JSON configuration with JsonTelegramBot
Home-page: https://github.com/sinofarmonov323/jsonbot
Author: https://t.me/jackson_rodger
License: MIT
Project-URL: Source, https://github.com/sinofarmonov323/JsonTelegramBot
Project-URL: Issues, https://github.com/sinofarmonov323/JsonTelegramBot/issues
Project-URL: Documentation, https://github.com/sinofarmonov323/JsonTelegramBot#readme
Keywords: telegram,telegram-bot,telegram-bot-api,json,json-config,python,osonbot
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Communications :: Chat
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: osonbot
Dynamic: author
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# JsonTelegramBot

Build lightweight **Telegram bots from JSON configuration** in Python. JsonTelegramBot
is a configuration-driven wrapper around

## Features

- Configure Telegram bot handlers with a Python dictionary or a JSON file.
- Reply to commands and text messages without writing repetitive handler code.
- Add an explicit `"*"` wildcard response for otherwise unhandled text.
- Handle inline callback data with `inline-messages`.
- Send a configured response to a specific Telegram user ID.
- Generate equivalent `osonbot` Python code.
- MIT licensed and compatible with Python 3.10 and newer.

# Installation
```shell
pip install json-telegram-bot
```

# Usage
```python
from JSONTelegramBot import JsonBot

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

## Generate osonbot code

Generate standalone Python code for the supported `osonbot` library:
```python
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 callback messages
```python
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
```python
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()
```

## License

JsonTelegramBot is released under the [MIT License](LICENSE).
