Django TelegramBot x WWW
With a certain command, the Telegram bot gives you a link to your chat ID.With a certain command, the Telegram bot gives you a link to your chat ID.You will have your link, which will have a status (wyświetlony w konsoli)
I I was given 3 databases of bot telegrams, workers, currency, users.The point was that I had to make 3 statuses for users and workers, status 0 - random values of the graph relative to (-2 ; 2), status 1 - winning, i.e. Jeśli osoba z statusem 1 stawia na downgrade, graf pójdzie w dół, ten sam pójdzie na promocję, status 2 jest stratą, tj.
Jeśli osoba z statusem 2 stawia na zmniejszeniu, graf będzie w górę z małym odstępem, zazwyczaj status 2 i 0 były używane dla użytkowników.I had to take this status in the database, in relation to the Telegram bot (of course, I informed the customer that he needed a separate server for the database, but at the moment I did it directly from the file), in which the "senior" could select a user and put his status, then the database was changing, so I made it so that the database was updated every time the page was loaded.Każdy użytkownik powinien mieć swoją stronę.Change the frontend, and a couple more exercises
Jak to zrobiłem?To begin with, I read the code of the bot's telegrams, read what is contained in the databases, read the entire code (około 50,000 lines), it was difficult to understand what was to what, because I was analyzing someone else's code, which was written very awkwardly, not broken down into blocks, not formed After that I realized that it would be best to write it in django, I rewrote all the code in django so that I could work both with python (on which the telegram bot is written) and to work with html.Po tym, zrobiłem własną stronę dla każdego użytkownika za pomocą identyfikator czatu z bazy użytkownika (to bazy danych zostało pobrane z bot Telegram, który, przy naciśnięciu przycisku Start, nagrywał wszystkie niezbędne informacje w bazie danych, i nagrywał dane domyślne dla nieznanych informacji).You won't be able to use the web page without a chat ID that is in your database. - Nie będziesz mógł korzystać z strony internetowej bez identyfikacji czatu, która znajduje się w Twojej bazie danych.That is, the path to the page should look something like this: https://YOUR_HOST/658257014.Status 0: Raindom integer, min 25 000, max 35 000.Sasa (-2, 2 )
Status 1: Win, min 25 000, max 35 000.Jeśli użytkownik zdecydował się na zwiększenie harmonogramu, szanse: (-2, 4)
Status 2: Loss, min 25 000, max 35 000.Jeśli użytkownik zdecydował się na zwiększenie harmonogramu, szanse: (-4, 2)
I I was given 3 databases of bot telegrams, workers, currency, users.The point was that I had to make 3 statuses for users and workers, status 0 - random values of the graph relative to (-2 ; 2), status 1 - winning, i.e. Jeśli osoba z statusem 1 stawia na downgrade, graf pójdzie w dół, ten sam pójdzie na promocję, status 2 jest stratą, tj.
Jeśli osoba z statusem 2 stawia na zmniejszeniu, graf będzie w górę z małym odstępem, zazwyczaj status 2 i 0 były używane dla użytkowników.I had to take this status in the database, in relation to the Telegram bot (of course, I informed the customer that he needed a separate server for the database, but at the moment I did it directly from the file), in which the "senior" could select a user and put his status, then the database was changing, so I made it so that the database was updated every time the page was loaded.Każdy użytkownik powinien mieć swoją stronę.Change the frontend, and a couple more exercises
Jak to zrobiłem?To begin with, I read the code of the bot's telegrams, read what is contained in the databases, read the entire code (około 50,000 lines), it was difficult to understand what was to what, because I was analyzing someone else's code, which was written very awkwardly, not broken down into blocks, not formed After that I realized that it would be best to write it in django, I rewrote all the code in django so that I could work both with python (on which the telegram bot is written) and to work with html.Po tym, zrobiłem własną stronę dla każdego użytkownika za pomocą identyfikator czatu z bazy użytkownika (to bazy danych zostało pobrane z bot Telegram, który, przy naciśnięciu przycisku Start, nagrywał wszystkie niezbędne informacje w bazie danych, i nagrywał dane domyślne dla nieznanych informacji).You won't be able to use the web page without a chat ID that is in your database. - Nie będziesz mógł korzystać z strony internetowej bez identyfikacji czatu, która znajduje się w Twojej bazie danych.That is, the path to the page should look something like this: https://YOUR_HOST/658257014.Status 0: Raindom integer, min 25 000, max 35 000.Sasa (-2, 2 )
Status 1: Win, min 25 000, max 35 000.Jeśli użytkownik zdecydował się na zwiększenie harmonogramu, szanse: (-2, 4)
Status 2: Loss, min 25 000, max 35 000.Jeśli użytkownik zdecydował się na zwiększenie harmonogramu, szanse: (-4, 2)