Telegram.Bot icon indicating copy to clipboard operation
Telegram.Bot copied to clipboard

Bot API 6.1 (June 20, 2022)

Open karb0f0s opened this issue 3 years ago • 4 comments

Bot API 6.1

Media in Descriptions

  • Added support for photos and videos in the 'What can this bot do?' section (shown on the bot's start screen). Use BotFather to set up media.

Web App Improvements

  • Added the fields version, headerColor, backgroundColor, BackButton, HapticFeedback and the methods isVersionAtLeast, setHeaderColor, setBackgroundColor, openLink, openTelegramLink, openInvoice to the class WebApp.
  • Added the field secondary_bg_color to the class ThemeParams.
  • Added the method offClick to the class MainButton.
  • Added the fields chat, can_send_after to the class WebAppInitData.
  • Added the events backButtonClicked, settingsButtonClicked, invoiceClosed.

Join Requests & Payments

  • Added the fields join_to_send_messages and join_by_request to the class Chat.
  • Added the ability to process join requests which were created without an invite link. Bots will receive a “chat_join_request” update as usual.
  • Added the method createInvoiceLink to generate an HTTP link for an invoice.

Telegram Premium Support (more info)

  • The maximum value of the field file_size in the classes Animation, Audio, Document, Video, Voice, and File can no longer be stored in a signed 32-bit integer type. This change is necessary to support 4GB files uploaded by premium accounts.
  • Added the field is_premium to the class User.
  • Added the field premium_animation to the class Sticker.

Attachment Menu Integration

  • Added the field added_to_attachment_menu to the class User.
  • Bots integrated in the attachment menu can now be used in groups, supergroups and channels.
  • 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.

Other Changes

  • Added the parameter secret_token to the method setWebhook.
  • As previously announced, only HTTPS links are now allowed in login_url inline keyboard buttons.

karb0f0s avatar Jun 21 '22 15:06 karb0f0s

I think we may release this as v18.1

tuscen avatar Jun 21 '22 17:06 tuscen

How to use HapticFeedback?

Umidrifkatov avatar Jul 11 '22 15:07 Umidrifkatov

How to use HapticFeedback?

Just figured it out! window.Telegram.WebApp.impactOccurred("medium")

Umidrifkatov avatar Jul 11 '22 15:07 Umidrifkatov

Which link I have to pass to - openInvoice(url[, callback])

May someone give an example of those parameters

Artem990 avatar Aug 01 '22 22:08 Artem990

Resolved by #1147.

tuscen avatar Dec 04 '22 01:12 tuscen

Which link I have to pass to - openInvoice(url[, callback])

May someone give an example of those parameters

The link created by this method - https://core.telegram.org/bots/api#createinvoicelink

yairhaimo avatar Nov 06 '23 10:11 yairhaimo