T
T
TTeratron2020-05-28 15:46:38
Python
TTeratron, 2020-05-28 15:46:38

How to implement dynamic dialogue building mechanism (aiogram or telethon or pytelegrambotapi or any other python framework)?

Task: the dialog is stored in the database (i.e. it can be changed by the designer), I get it from the database and form a transition graph (the text of the dialogue is the top of the graph, the buttons determine the transition to the next tops). The question is now how to dynamically build a dialogue based on this state graph while the bot is running. Need an idea.
As I see it: having a built graph, you need to dynamically generate the handlen code and register it. That's the load: How to create a dynamic handler with your own processing code, and then register it? There is a suspicion that it is necessary to use lambda functions, but I do not understand yet how. Maybe someone will tell?

Perhaps there are ready-made frameworks for studying architecture (no matter what language) I will be grateful.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question