Skip to main content

A simple Json object to Bot library built on top of a osonbot library

Project description

JsonBot

Installation

pip install jsonbot

Usage

from jsonbot import JsonBot

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

you can generate code to osonbot library itself (but not fully prepared)

from jsonbot import JsonBot

JsonBot("token", {
    "/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 jsonbot 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()

Done

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsonbot-1.0.6.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jsonbot-1.0.6-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file jsonbot-1.0.6.tar.gz.

File metadata

  • Download URL: jsonbot-1.0.6.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for jsonbot-1.0.6.tar.gz
Algorithm Hash digest
SHA256 929548605c0b3d0fbfdcf64a0dd65f891b7675a5c4c1aed629341bacc2d7098d
MD5 b0679473cb5c6b654537e7aa1f058ead
BLAKE2b-256 82de4d958e9aca7c97dc5557cb08d4cfe95889ba621301d73816b43ffc9e8326

See more details on using hashes here.

File details

Details for the file jsonbot-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: jsonbot-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 2.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for jsonbot-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3492aab2693d3ddb13bc6f5c296c260dd7c7644044f69b10fc16bc17d5abfd5a
MD5 3a76fb482795980ba9b71099044c611e
BLAKE2b-256 1f6917cfd2230e4229c63b282ccfd438615158b05f49eba89076ff4c0598d2c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page