After receiving the message, the bot can continue communicating with the user. The bot can call the Bot API method answerWebAppQuery to send an inline message from the user back to the bot and close the Web App. In addition to the user's theme settings, it will receive basic user information ( ID, name, username, language_code) and a unique identifier for the session, query_id, which allows messages on behalf of the user to be sent back to the bot. If receiving text data alone is insufficient or you need a more advanced and personalized interface, you can open a Web App using a web_app type Inline KeyboardButton.įrom the button, a Web App will open with the URL specified in the button. TL DR: For more interactive Web Apps like use a web_app type Inline KeyboardButton, which gets basic user information and can be used to send a message on behalf of the user to the chat with the bot. Reusable components that do not depend on a particular bot.Сustom data input interfaces (a personalized calendar for selecting dates selecting data from a list with advanced search options a randomizer that lets the user “spin a wheel” and chooses one of the available options, etc.).The bot can continue communicating with the user after receiving it. Data will be transmitted to the bot as a String in a service message. To transmit data from the user back to the bot, the Web App can call the method. You can send a web_app type KeyboardButton that opens a Web App from the specified URL. For even more flexibility, bots can utilize the full power of HTML5 to create user-friendly input interfaces. Users can interact with bots using custom keyboards, buttons under bot messages, as well as by sending freeform text messages or any of the attachment types supported by Telegram: photos and videos, files, locations, contacts and polls. This makes it possible for the bot to produce a response without communicating with any external servers. TL DR: Web Apps launched from a web_app type keyboard button can send data back to the bot in a service message using. For example, when users switch between Day and Night modes or use various custom themes. Web Apps always receive data about the user's current color theme in real time, so you can adjust the appearance of your interfaces to match it. Added the events backButtonClicked, settingsButtonClicked, invoiceClosed.Added the fields chat, can_send_after to the class WebAppInitData.Added the method offClick to the class MainButton.Added the field secondary_bg_color to the class ThemeParams.Added the fields version, headerColor, backgroundColor, BackButton, HapticFeedback and the methods isVersionAtLeast, setHeaderColor, setBackgroundColor, openLink, openTelegramLink, openInvoice to the class WebApp.Added support for t.me links that can be used to select the chat in which the attachment menu with the bot will be opened.Added the ability to use bots added to the attachment menu in group, supergroup and channel chats.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |