diff --git a/CHANGELOG.md b/CHANGELOG.md index d8e6351..53b5f82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.23.0 + +- 🤖 Bot API 7.8 +- Added `User.hasMainWebApp` +- Support for managing pinned messages on behalf of user (Business Bots) + # 1.22.5 - Just a re-release to move the repo to [@Xooniverse](https://github.com/xooniverse) diff --git a/README.md b/README.md index af93caf..25b5cfc 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Pub Version](https://img.shields.io/pub/v/televerse?color=blue&logo=blue)](https://pub.dev/packages/televerse) ![GitHub](https://img.shields.io/github/license/xooniverse/televerse?color=green) -![](https://shields.io/badge/Latest-Bot%20API%207.7-blue) +![](https://shields.io/badge/Latest-Bot%20API%207.8-blue) @@ -13,7 +13,7 @@ --- -🤖 `Bot API version: Bot API 7.7 (July 7, 2024)` +🤖 `Bot API version: Bot API 7.8 (July 31, 2024)` Televerse is a powerful, easy-to-use, and highly customizable Telegram bot framework built with Dart programming language. It provides a complete and @@ -23,13 +23,14 @@ public interface, making it easy for developers to write strictly typed code. ## 🔥 What's latest? -### 🤖 Bot API 7.7 +### 🤖 Bot API 7.8 -(🗓️ July 8, 2024) +(🗓️ July 31, 2024) -Simply, this change brings support for Refunds of Payment. +Simply, this change brings support for ability to manage pinned messages on behalf of a Business. +Much more updates on Mini apps. -Checkout [changelog](https://core.telegram.org/bots/api#july-7-2024) for more +Checkout [changelog](https://core.telegram.org/bots/api#july-31-2024) for more details! 🚀 ### 🎉 Support for Custom Contexts! @@ -46,7 +47,8 @@ Televerse now lets you build even more powerful bots with custom contexts! With the new `Bot.contextBuilder` method, you can define specialized context constructors to create context objects with personalized behaviors and capabilities. This update allows you to tailor your bot's responses, handle -complex workflows, and integrate additional features seamlessly. +complex workflows, and integrate additional features seamlessly. +[Read more here.](https://televerse.xooniverse.com/doc/custom-context)
diff --git a/lib/src/telegram/models/user.dart b/lib/src/telegram/models/user.dart index 7f051cb..deddb78 100644 --- a/lib/src/telegram/models/user.dart +++ b/lib/src/telegram/models/user.dart @@ -39,6 +39,9 @@ class User implements WithID { /// Optional. True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe. final bool? canConnectToBusiness; + /// Optional. True, if the bot has a main Web App. Returned only in getMe. + final bool? hasMainWebApp; + /// Constructs a [User] object const User({ required this.id, @@ -53,6 +56,7 @@ class User implements WithID { this.canReadAllGroupMessages, this.supportsInlineQueries, this.canConnectToBusiness, + this.hasMainWebApp, }); /// Creates a [User] object from JSON object @@ -70,6 +74,7 @@ class User implements WithID { canReadAllGroupMessages: json['can_read_all_group_messages'], supportsInlineQueries: json['supports_inline_queries'], canConnectToBusiness: json['can_connect_to_business'], + hasMainWebApp: json['has_main_web_app'], ); } @@ -88,6 +93,7 @@ class User implements WithID { 'can_read_all_group_messages': canReadAllGroupMessages, 'supports_inline_queries': supportsInlineQueries, 'can_connect_to_business': canConnectToBusiness, + 'has_main_web_app': hasMainWebApp, }..removeWhere(_nullFilter); } } diff --git a/lib/src/televerse/api/raw_api.dart b/lib/src/televerse/api/raw_api.dart index f48f353..1650174 100644 --- a/lib/src/televerse/api/raw_api.dart +++ b/lib/src/televerse/api/raw_api.dart @@ -1945,11 +1945,13 @@ class RawAPI { ID chatId, int messageId, { bool? disableNotification, + String? businessConnectionId, }) async { final params = { "chat_id": chatId.id, "message_id": messageId, "disable_notification": disableNotification, + "business_connection_id": businessConnectionId, }; final response = await _makeApiBoolCall( APIMethod.pinChatMessage, @@ -1961,11 +1963,13 @@ class RawAPI { /// Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success. Future unpinChatMessage( ID chatId, - int messageId, - ) async { + int messageId, { + String? businessConnectionId, + }) async { final params = { "chat_id": chatId.id, "message_id": messageId, + "business_connection_id": businessConnectionId, }; final response = await _makeApiBoolCall( APIMethod.unpinChatMessage, diff --git a/pubspec.yaml b/pubspec.yaml index ab0dcc3..0d53331 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,8 @@ name: televerse -description: Televerse lets you create your own efficient Telegram bots with ease in Dart. Supports latest Telegram Bot API - 7.7! -version: 1.22.5 -homepage: https://github.com/xooniverse/televerse +description: Televerse lets you create your own efficient Telegram bots with ease in Dart. Supports latest Telegram Bot API - 7.8! +version: 1.23.0 +homepage: https://televerse.xooniverse.com +repository: https://github.com/xooniverse/televerse topics: - telegram - bot