Metadata-Version: 2.1
Name: mkBot
Version: 1.0.0
Summary: An easy way to crate inline Telegram bots and you can get json file from the user answers
Author-email: moh0009 <23ii.mancy@gmail.com>
Project-URL: Homepage, https://github.com/moh0009/mkBot
Project-URL: Issues, https://github.com/moh0009/mkBot/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyTelegramBotAPI

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

### usage example

```python
import telebot
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 
