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
Telegram Bot RPGHello, dear programmers! I am looking for a developer to create a Telegram project in the format of a text-based role-playing game (RPG) in the Eurovision universe (similar to text-based role-playing Club Romance). Please read the concept step by step and give your feedback on… Gaming Apps, Bot Development ∙ 8 hours 14 minutes back ∙ 45 proposals |
Technical Specification for Refinement of AI Bot for Generating Personalized SongsTECHNICAL TASK FOR IMPROVING THE AI PERSONAL SONG GENERATOR BOTMAIN GOAL Create a stable premium product that: generates the highest quality personal songs; does not fabricate facts about the client; works stably under load; is easily scalable; allows for analysis and… Python, Bot Development ∙ 9 hours 6 minutes back ∙ 23 proposals |
A bot needs to be created in Telegram for subscription payment.
45 USD
A bot needs to be created in Telegram where users can subscribe for access to the webcams located in the yard. Organize payment for two types of subscriptions (monthly and daily) in the bot. The bot should automatically check the payment and then provide access links. Python, Bot Development ∙ 1 day 1 hour back ∙ 74 proposals |
Development of an AI consultant for a work visa verification website (WordPress)Development of an AI Consultant for a Work Visa Check Website (WordPress) About the Project An English-language website is being developed for the preliminary check of eligibility for a work visa in Israel. An AI consultant in the format of an online chat is needed to assist… AI & Machine Learning, Bot Development ∙ 1 day 7 hours back ∙ 34 proposals |
SMM + content manager for an IT school - experience with funnels and course promotionAbout us A young practical IT education project at the start. We are preparing the first batch of the PM course and building channels from scratch. We are looking for a person with whom we will grow. What needs to be done We have a vision, but no written strategy. We are looking… Social Media Marketing (SMM), Bot Development ∙ 2 days 8 hours back ∙ 24 proposals |