From d6c9ad370a1b03864fcbfc0856d97eadbb5b4ee2 Mon Sep 17 00:00:00 2001 From: acatec Date: Thu, 10 Oct 2024 19:41:49 +0700 Subject: [PATCH] added getBusinessConnection method https://core.telegram.org/bots/api#getbusinessconnection --- methods.go | 7 +++++++ methods_params.go | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/methods.go b/methods.go index a10eec7..b450bf4 100644 --- a/methods.go +++ b/methods.go @@ -538,6 +538,13 @@ func (b *Bot) GetUserChatBoosts(ctx context.Context, params *GetUserChatBoostsPa return result, err } +// GetBusinessConnection https://core.telegram.org/bots/api#getBusinessConnection +func (b *Bot) GetBusinessConnection(ctx context.Context, params *GetBusinessConnectionParams) (*models.BusinessConnection, error) { + result := &models.BusinessConnection{} + err := b.rawRequest(ctx, "getBusinessConnection", params, &result) + return result, err +} + // SetMyCommands https://core.telegram.org/bots/api#setmycommands func (b *Bot) SetMyCommands(ctx context.Context, params *SetMyCommandsParams) (bool, error) { var result bool diff --git a/methods_params.go b/methods_params.go index 7d6d20d..67c90b7 100644 --- a/methods_params.go +++ b/methods_params.go @@ -634,6 +634,11 @@ type GetUserChatBoostsParams struct { UserID int `json:"user_id"` } +// GetUserChatBoostsParams https://core.telegram.org/bots/api#getbusinessconnection +type GetBusinessConnectionParams struct { + BusinessConnectionID any `json:"business_connection_id"` +} + type SetMyCommandsParams struct { Commands []models.BotCommand `json:"commands"` Scope models.BotCommandScope `json:"scope,omitempty"`