Telegram bot
The initial database structure can be modified.
users
| id | chat_id | tgid | tgname | phone |
users_actions
| user_id | message |
admins
| id | chat_id | tgid | tgname | phone | status |
subbuttons1
| id | text | status |
subbuttons2
| id | text | status |
support_dialogs
table fields based on p.5.1.
Bot operation algorithm:
1. Welcome message to all users who enter the bot.
1.1. Check in the admins field of the database if the user is present. If the user's tgid or tgname does not match what is in the database, then ask them to share their phone number and verify if such a number exists in admins. If an admin is found with any identifier, display the message "Admin, You are authorized, expect further messages." Any messages from the user are ignored in this case. If the user is not in the admins table, proceed to step 1.2.
1.2. Check in the users field of the database if the user is present. If the user's tgid or tgname matches what is in the database, then proceed to step 2, otherwise ask them to share their phone number and verify if such a number exists in the users table. If it does, also proceed to step 2. If not, display the message "You are not authorized."
2. Next, display two buttons in the dialogue "Button 1" and "Button 2".
3. If the user writes a random message in the bot without selecting any button - write a message that one of the options must be chosen and display these two buttons again.
4. If the user selects "Button 1", then:
4.1. Display the message "Message text for Button 1"
4.2. Display additional buttons in the dialogue as a list, taken from the subbuttons1 table in the database if status= active. The text field is the button name.
4.3. Next, the user must choose one of the displayed buttons. If a random message is written at this stage without selecting a button, display the buttons from step 4.2 again with the message "One of the options must be chosen to continue." Remember the selected button option for future use.
4.4. Display additional buttons in the dialogue as a list, taken from the subbuttons2 table in the database if status= active. The text field is the button name.
4.5. Next, the user must choose one of the displayed buttons. If a random message is written at this stage without selecting a button, display the buttons from step 4.4 again with the message "One of the options must be chosen to continue." Remember the selected button option for future use.
4.6. Now, having two options of pressed buttons from step 4.2 and step 4.4, display the message "Enter any number." Check if it is a number, it can be a non-integer value rounded to the nearest thousandth. Remember that number. If an incorrect number was entered or a random message, display "Enter any number to continue."
4.7. Display a message in the following format:
- You have chosen: "Text of the selected button from subbuttons1"
- You have chosen: "Text of the selected button from subbuttons2"
- Your number: "Entered number"
- Two buttons "OK" and "Cancel"
4.8. If "OK" is pressed, display the message "Message when OK is pressed" and record the message from step 4.7 in the users_actions table in the database and display it in the same bot for users from the admins table with status active.
4.9. If "Cancel" is pressed, display the first two buttons from step 2. If a random message is entered instead of selected options, display the text "One of the options must be chosen to complete."
5. If "Button 2" is selected, display the message:
- Write your question and we will provide an answer.
5.1. Here, it is necessary to save the user's written message or multiple messages in our database in the support_dialogs table.
Client's review of cooperation with Dmitro Deren
Telegram botTasks were implemented professionally, quickly, and thoughtfully. Dmytro anticipates many nuances in advance that may arise during the work on the final product. I recommend working together and will also contact him again!
Freelancer's review of cooperation with Oleksandr Stasyuk
Telegram botEverything went great, Alexander provided a clear brief, was always in touch, promptly answered questions.
-
Andrey Burdin FerretGroup
Доброго дня! А принципово на пхп?
-
Current freelance projects in the category Bot Development
I am looking for a strong specialist in trading bots and agents.
250 USD
It is important to start - TODAY I need a person who has experience in writing trading bots on DEXs (needed on the BSC network) with an understanding of transaction costs, gas, etc. I want to test several trading strategies on a real trading agent I need to quickly… Cryptocurrency & Blockchain, Bot Development ∙ 15 hours 35 minutes back ∙ 19 proposals |
Creation of a TikTok farm with income generation
601 USD
Looking for a person who can write software for a TikTok farm, so we can generate traffic and earn income. We are seeking a ready-made solution with a full cycle. Python, Bot Development ∙ 1 day 17 hours back ∙ 15 proposals |
Pocket Option trading bot
71 USD
I need a bot and your expertise who has already been able to create a similar bot when the bets are correct, they are read from Pocket Option I am interested in Brent Oil I do not need a beginner or someone who will just write code for the sake of it I need someone who knows… AI & Machine Learning, Bot Development ∙ 2 days 18 hours back ∙ 19 proposals |
TG BOT for Auto Ria
156 USD
We are interested in creating a bot that can send 1000+ exchange offers per day from one account. Authorization through Ria login and password, with characteristics exclusively those listed on the portal. The ability to limit the number of exchange requests. Also, monitoring… Bot Development ∙ 2 days 19 hours back ∙ 43 proposals |
Integration of Viber in 8.3
223 USD
Need Viber integration into own CRM (1C 8.3)About the Company The company "Domofon System" is engaged in the installation and maintenance of intercom systems. Base of over 40,000 subscribers. We work on our own customized system based on 1C 8.3. We are looking for a specialist… Databases & SQL, Bot Development ∙ 2 days 20 hours back ∙ 16 proposals |