Answer the question
In order to leave comments, you need to log in
What is the best way and how to do it?
Hello! I am writing a telegram bot and thus learning the Python language.
I'm interested in the question.
What is the best way to organize the loading of information in the form of a description, files: several photos, a document of the docx, pdf extension using a database or writing directly in the code?
The bot looks like this: a person enters a certain number, for example 123, under this number you need to display a description, files (several photos, and documents: 1 docx, 1 pdf). The bot gave out information and offers a search for other numbers, and the process is repeated. If a person entered a number incorrectly, the bot writes the message "Oops... there is no such command... please re-enter".
How can this be organized: using conditions or a loop?
There are so many numbers...
It is necessary to make sure that the user receives specific data and files from the bot.
Answer the question
In order to leave comments, you need to log in
Graph. states.
https://refactoring.guru/ru/design-patterns/state
What is the best way to organize the loading of information in the form of a description, files: several photos, a document of the docx, pdf extension using a database or writing directly in the code?
zifrZifrAiLyLy=123
{
//document and foto list
doc 123
foto 123_1
foto123_2
и тд
}
How can this be organized: using conditions or a loop?- main loop processing user input + conditions
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question