From 77f9f70200a234bb79331ede31715832fbca7e1e Mon Sep 17 00:00:00 2001 From: KnorpelSenf Date: Wed, 31 Jul 2024 21:36:00 +0200 Subject: [PATCH] feat: support Bot API 7.8 (#52) --- manage.ts | 4 +++- methods.ts | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/manage.ts b/manage.ts index 191ca45..8cf0c10 100644 --- a/manage.ts +++ b/manage.ts @@ -60,7 +60,9 @@ export interface UserFromGetMe extends User { /** True, if the bot supports inline queries. Returned only in getMe. */ supports_inline_queries: boolean; /** True, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in getMe. */ - can_connect_to_business?: boolean; + can_connect_to_business: boolean; + /** True, if the bot has main Web App. Returned only in getMe. */ + has_main_web_app: boolean; } export declare namespace Chat { diff --git a/methods.ts b/methods.ts index 8f559c4..ec980a6 100644 --- a/methods.ts +++ b/methods.ts @@ -1097,6 +1097,8 @@ export type ApiMethods = { /** Use this method to add a message to 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' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns True on success. */ pinChatMessage(args: { + /** Unique identifier of the business connection on behalf of which the message will be pinned */ + business_connection_id?: string; /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */ chat_id: number | string; /** Identifier of a message to pin */ @@ -1107,9 +1109,11 @@ export type ApiMethods = { /** 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' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns True on success. */ unpinChatMessage(args: { + /** Unique identifier of the business connection on behalf of which the message will be unpinned */ + business_connection_id?: string; /** Unique identifier for the target chat or username of the target channel (in the format @channelusername) */ chat_id: number | string; - /** Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned. */ + /** Identifier of the message to unpin. Required if business_connection_id is specified. If not specified, the most recent pinned message (by sending date) will be unpinned. */ message_id?: number; }): true;