Help solve the problem with the WebApp in the Telegram bot
Hello, I need help with developing a bot in Telegram using WebApp
Main components of the bot
- Web application (index.html): An interface for selecting the date and time of booking, integrated into Telegram as a WebApp.
- Configuration file (.env): Contains necessary settings such as the bot token, group ID for receiving bookings, and the URL of the web application.
- Bot script (bot_start.py): The main code of the bot that handles user interaction.
- Dependencies file (requirements): Defines the necessary libraries for the bot to function.
Detailed description of the bot's operation
1. Starting interaction (/start)
- Command
/startinitiates a dialogue with the user. - The bot greets the user and offers two options:
- "Book a table"
- "View menu"
2. Viewing the menu
- If the user selects "View menu", the bot sends a link to the menu (
https://gustouapp.com/menu) and returns the user to the initial action selection.
3. Booking a table
Selecting a venue
- When selecting "Book a table", the bot asks to choose one of the available venues (for example,
'Vul. Antonovicha'or'pr-t. Tichina').
Selecting date and time
- After selecting a venue, the bot sends a button "Select date and time", which opens the WebApp (your
index.html). - The web application uses the Flatpickr library for convenient date and time selection.
- The user selects the desired date and time.
- After confirmation, the selected date and time are sent back to the bot via
window.Telegram.WebApp.sendData(selectedDatetime).
Processing data from WebApp
- The bot receives the selected date and time and confirms them to the user.
- Then the bot asks for the number of guests.
4. Entering the number of guests
- The user enters the number of guests.
- The bot checks if the entered value is a valid number greater than zero.
- After confirmation, the bot asks for the name.
5. Entering the name
- The user enters their name.
- The bot saves the name and proceeds to choose the method of providing the contact phone number:
- "Enter number manually"
- "Share contact"
6. Providing the contact phone number
Selecting the method of providing the number
- "Enter number manually":
- The bot asks to enter the number in the format
+380XXXXXXXXX. - Checks the validity of the entered number.
- The bot asks to enter the number in the format
- "Share contact":
- The bot provides a button to share the contact.
- The user presses the button, and their phone number is automatically sent to the bot.
7. Completing the booking
- After receiving all necessary data (venue, date and time, number of guests, name, phone), the bot forms the booking information.
- Booking information is sent to the group chat (
GROUP_CHAT_ID), where administrators can review and confirm it. - The bot thanks the user for the booking and offers:
- "Return to the beginning"
- "View menu"
8. Error handling and cancellation
- If an error occurs while sending the booking, the bot informs the user to try again.
- The user can cancel the booking process with the command
/cancel, and the bot returns them to the initial state or ends the conversation.
Interaction between components
- The user starts interaction with the bot through Telegram.
- The bot processes commands and messages, managing the state of the conversation using
ConversationHandler. - When selecting a date and time, the bot opens the WebApp (your
index.html) in Telegram. - The web application allows the user to select the date and time, after which it sends this data back to the bot.
- The bot receives this data, continues the booking process, collecting the necessary information.
- After completion, the bot sends the booking information to the specified group for further processing.
The problem is that when the WebApp opens, it always shows that it is not opened through Telegram, below are examples of the bot files
Applications 1
Client's review of cooperation with Ivan O.
Help solve the problem with the WebApp in the Telegram botVery quickly completed the work
Freelancer's review of cooperation with Andrii Spiridonov
Help solve the problem with the WebApp in the Telegram botEverything went smoothly and easily. I recommend it.
-
Good day
I know what your problem is and how to solve it
I am ready to do it right now.
-
369 1 0 Good day, I will try to work on your bot.
I have already dealt with bots, so I have an idea of what needs to be done!
I would like to know more details in private messages.
Current freelance projects in the category Bot Development
Long-term collaboration with an AI / No-Code developer for premium Enterprise projects.
935 USD
Hello! Our international AI agency "Neural Sharks" provides high-level autonomous digital infrastructure for large corporate businesses in Scandinavia (Norway). We specialize in deploying ultra-fast voice AI agents, deep financial analytics systems (Data Sharks), and AI design… AI & Machine Learning, Bot Development ∙ 6 hours 13 minutes back ∙ 7 proposals |
Telegram bot for automatic interviewing of veterinarians with OpenAI integration
22 USD
Goal: to maximize the automation of the initial selection of candidates without the involvement of the employer. 1. The candidate follows the link to the Telegram bot and starts the interview with the command /start. 2. The bot sequentially asks 18 pre-set questions. 3. Answers… AI & Machine Learning, Bot Development ∙ 9 hours 57 minutes back ∙ 57 proposals |
Development of a Telegram botCreation of a Telegram bot with a funnel for viewing free materials and then the possibility of purchasing the main course for listening to audio tracks Without the possibility of sharing or downloading audio tracks A detailed architecture is attached in the file.… Bot Development ∙ 13 hours 11 minutes back ∙ 56 proposals |
Automation setup: Form on the website → WhatsApp bot → CRM (Make + WATI)Project Description: There is a transportation company website. Clients submit requests through a form on the site — the form is sent to email. We need to set up the following automation:Stage 1 — Form → WhatsApp — When a new request comes to the email from the website, the… Web Programming, Bot Development ∙ 2 days 6 hours back ∙ 48 proposals |
Telegram chatbot for a closed club
22 USD
Good day! I need to set up a bot for Telegram. Task: selling access to a closed channel. The bot should accept payments and after successful payment, issue a one-time invitation link. It is also necessary to set up automatic removal of a participant from the channel when their… Bot Development ∙ 4 days 17 hours back ∙ 97 proposals |