Skip to main content

MkBot is an easy way to crate inline Telegram bots and you can get json file from the user answers

usage example

import telebot
from mkBot import mkBot
from telebot.types import InlineKeyboardButton

# bot
bot = telebot.TeleBot("Bot_token")

# functions
def all(msg):
    main.save(msg, msg.text)
    main.check("send", msg) 

def question(msg):
    all(msg)
    main.gen_json("output.json")

# the questions list
questions = [
    {
        "id" : 1,
        "text" : "Do you want to start ?",
        "buttons" : [
                [InlineKeyboardButton("start", callback_data="yes")]
        ]
    },
    {
        "id" : 2,
        "text" : "How old are you",
        "json_name" : "age",
        "function": question
        
    },
    {
        "id" : 3,
        "text" :  "the answers has been send",
        "buttons" : [
            [InlineKeyboardButton("again ?", callback_data="new")],
        ]
    },
]

# define the main class
main = mkBot.Main(queslist = questions, bot = bot)

@bot.message_handler(func = lambda message:True)
def message(msg):
    if msg.text == "/start":
        main.send_frist(msg)


# the callback handler that gets all inline buttons when has been clicked
@bot.callback_query_handler(func=lambda chosen_inline_result:True)
def inline(call):
    main.save(call.message, call.data)

    if main.index < len(questions) - 1:
        main.check("edit", call.message)
    else:
        main.send_frist(call.message)

bot.polling()

for more informations see the source code

Metadata

Release files for mkBot 1.0.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 mkBot 1.0.1
File Size Uploaded Provenance Actions
mkbot-1.0.1.tar.gz 3.6 kB Without provenance Details for mkbot-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mkBot 1.0.1
File Interpreter ABI Platform Actions
mkbot-1.0.1-py3-none-any.whl Python 3 none any Details for mkbot-1.0.1-py3-none-any.whl

Total release size: 7.6 kB

Release files / mkbot-1.0.1.tar.gz

Download URL mkbot-1.0.1.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
335d7567b814320961aa9448ea28efc598c5aca228f7a9bf7256cf9e5bf0a4dc
BLAKE2b-256 checksum
How to use checksums
e3e47519ae7e4d87619b2fb8f9ece5e9f52f1f625177153c3cc27cc74fc583c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / mkbot-1.0.1-py3-none-any.whl

Download URL mkbot-1.0.1-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
017ac4dfe64714e37ebd1d7c23b77cea71e2306fe2c13ff09dd9b7319859c71b
BLAKE2b-256 checksum
How to use checksums
d720c5b23fc5b57f097dba08a7d0b0f3e87263ea9efca6618d661b8a3abd7b2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Security for mkBot 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

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