(new): support Bot API 10.3
Golang lint / lint (push) Failing after 1m37s

(fix): finalize v2 contracts
(tests): cover v2 migration
(doc): prepare release guidance
This commit is contained in:
2026-09-08 23:21:38 +03:00
parent 24040fe164
commit d78526242b
88 changed files with 2321 additions and 918 deletions
+46 -46
View File
@@ -19,7 +19,7 @@ type VerifyUser struct {
// See https://core.telegram.org/bots/api#verifyuser
func (api *API) VerifyUser(params VerifyUser) (bool, error) {
req := NewRequest[bool]("verifyUser", params)
return req.Do(api)
return api.Do(req)
}
// VerifyUserWithContext is the context-aware variant of VerifyUser.
@@ -28,7 +28,7 @@ func (api *API) VerifyUser(params VerifyUser) (bool, error) {
// See https://core.telegram.org/bots/api#verifyuser
func (api *API) VerifyUserWithContext(ctx context.Context, params VerifyUser) (bool, error) {
req := NewRequest[bool]("verifyUser", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// VerifyChat holds parameters for the verifyChat method.
@@ -49,7 +49,7 @@ type VerifyChat struct {
// See https://core.telegram.org/bots/api#verifychat
func (api *API) VerifyChat(params VerifyChat) (bool, error) {
req := NewRequest[bool]("verifyChat", params)
return req.Do(api)
return api.Do(req)
}
// VerifyChatWithContext is the context-aware variant of VerifyChat.
@@ -58,7 +58,7 @@ func (api *API) VerifyChat(params VerifyChat) (bool, error) {
// See https://core.telegram.org/bots/api#verifychat
func (api *API) VerifyChatWithContext(ctx context.Context, params VerifyChat) (bool, error) {
req := NewRequest[bool]("verifyChat", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// RemoveUserVerification holds parameters for the removeUserVerification method.
@@ -75,7 +75,7 @@ type RemoveUserVerification struct {
// See https://core.telegram.org/bots/api#removeuserverification
func (api *API) RemoveUserVerification(params RemoveUserVerification) (bool, error) {
req := NewRequest[bool]("removeUserVerification", params)
return req.Do(api)
return api.Do(req)
}
// RemoveUserVerificationWithContext is the context-aware variant of RemoveUserVerification.
@@ -84,7 +84,7 @@ func (api *API) RemoveUserVerification(params RemoveUserVerification) (bool, err
// See https://core.telegram.org/bots/api#removeuserverification
func (api *API) RemoveUserVerificationWithContext(ctx context.Context, params RemoveUserVerification) (bool, error) {
req := NewRequest[bool]("removeUserVerification", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// RemoveChatVerification holds parameters for the removeChatVerification method.
@@ -102,7 +102,7 @@ type RemoveChatVerification struct {
// See https://core.telegram.org/bots/api#removechatverification
func (api *API) RemoveChatVerification(params RemoveChatVerification) (bool, error) {
req := NewRequest[bool]("removeChatVerification", params)
return req.Do(api)
return api.Do(req)
}
// RemoveChatVerificationWithContext is the context-aware variant of RemoveChatVerification.
@@ -111,7 +111,7 @@ func (api *API) RemoveChatVerification(params RemoveChatVerification) (bool, err
// See https://core.telegram.org/bots/api#removechatverification
func (api *API) RemoveChatVerificationWithContext(ctx context.Context, params RemoveChatVerification) (bool, error) {
req := NewRequest[bool]("removeChatVerification", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// ReadBusinessMessage holds parameters for the readBusinessMessage method.
@@ -134,7 +134,7 @@ type ReadBusinessMessage struct {
// See https://core.telegram.org/bots/api#readbusinessmessage
func (api *API) ReadBusinessMessage(params ReadBusinessMessage) (bool, error) {
req := NewRequest[bool]("readBusinessMessage", params)
return req.Do(api)
return api.Do(req)
}
// ReadBusinessMessageWithContext is the context-aware variant of ReadBusinessMessage.
@@ -143,7 +143,7 @@ func (api *API) ReadBusinessMessage(params ReadBusinessMessage) (bool, error) {
// See https://core.telegram.org/bots/api#readbusinessmessage
func (api *API) ReadBusinessMessageWithContext(ctx context.Context, params ReadBusinessMessage) (bool, error) {
req := NewRequest[bool]("readBusinessMessage", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// GetBusinessConnection holds parameters for the getBusinessConnection method.
@@ -159,7 +159,7 @@ type GetBusinessConnection struct {
// See https://core.telegram.org/bots/api#getbusinessconnection
func (api *API) GetBusinessConnection(params GetBusinessConnection) (BusinessConnection, error) {
req := NewRequest[BusinessConnection]("getBusinessConnection", params)
return req.Do(api)
return api.Do(req)
}
// GetBusinessConnectionWithContext is the context-aware variant of GetBusinessConnection.
@@ -168,7 +168,7 @@ func (api *API) GetBusinessConnection(params GetBusinessConnection) (BusinessCon
// See https://core.telegram.org/bots/api#getbusinessconnection
func (api *API) GetBusinessConnectionWithContext(ctx context.Context, params GetBusinessConnection) (BusinessConnection, error) {
req := NewRequest[BusinessConnection]("getBusinessConnection", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// DeleteBusinessMessages holds parameters for the deleteBusinessMessages method.
@@ -189,7 +189,7 @@ type DeleteBusinessMessages struct {
// See https://core.telegram.org/bots/api#deletebusinessmessages
func (api *API) DeleteBusinessMessages(params DeleteBusinessMessages) (bool, error) {
req := NewRequest[bool]("deleteBusinessMessages", params)
return req.Do(api)
return api.Do(req)
}
// DeleteBusinessMessagesWithContext is the context-aware variant of DeleteBusinessMessages.
@@ -198,7 +198,7 @@ func (api *API) DeleteBusinessMessages(params DeleteBusinessMessages) (bool, err
// See https://core.telegram.org/bots/api#deletebusinessmessages
func (api *API) DeleteBusinessMessagesWithContext(ctx context.Context, params DeleteBusinessMessages) (bool, error) {
req := NewRequest[bool]("deleteBusinessMessages", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// SetBusinessAccountName holds parameters for the setBusinessAccountName method.
@@ -219,7 +219,7 @@ type SetBusinessAccountName struct {
// See https://core.telegram.org/bots/api#setbusinessaccountname
func (api *API) SetBusinessAccountName(params SetBusinessAccountName) (bool, error) {
req := NewRequest[bool]("setBusinessAccountName", params)
return req.Do(api)
return api.Do(req)
}
// SetBusinessAccountNameWithContext is the context-aware variant of SetBusinessAccountName.
@@ -228,7 +228,7 @@ func (api *API) SetBusinessAccountName(params SetBusinessAccountName) (bool, err
// See https://core.telegram.org/bots/api#setbusinessaccountname
func (api *API) SetBusinessAccountNameWithContext(ctx context.Context, params SetBusinessAccountName) (bool, error) {
req := NewRequest[bool]("setBusinessAccountName", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// SetBusinessAccountUsername holds parameters for the setBusinessAccountUsername method.
@@ -247,7 +247,7 @@ type SetBusinessAccountUsername struct {
// See https://core.telegram.org/bots/api#setbusinessaccountusername
func (api *API) SetBusinessAccountUsername(params SetBusinessAccountUsername) (bool, error) {
req := NewRequest[bool]("setBusinessAccountUsername", params)
return req.Do(api)
return api.Do(req)
}
// SetBusinessAccountUsernameWithContext is the context-aware variant of SetBusinessAccountUsername.
@@ -256,7 +256,7 @@ func (api *API) SetBusinessAccountUsername(params SetBusinessAccountUsername) (b
// See https://core.telegram.org/bots/api#setbusinessaccountusername
func (api *API) SetBusinessAccountUsernameWithContext(ctx context.Context, params SetBusinessAccountUsername) (bool, error) {
req := NewRequest[bool]("setBusinessAccountUsername", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// SetBusinessAccountBio holds parameters for the setBusinessAccountBio method.
@@ -275,7 +275,7 @@ type SetBusinessAccountBio struct {
// See https://core.telegram.org/bots/api#setbusinessaccountbio
func (api *API) SetBusinessAccountBio(params SetBusinessAccountBio) (bool, error) {
req := NewRequest[bool]("setBusinessAccountBio", params)
return req.Do(api)
return api.Do(req)
}
// SetBusinessAccountBioWithContext is the context-aware variant of SetBusinessAccountBio.
@@ -284,7 +284,7 @@ func (api *API) SetBusinessAccountBio(params SetBusinessAccountBio) (bool, error
// See https://core.telegram.org/bots/api#setbusinessaccountbio
func (api *API) SetBusinessAccountBioWithContext(ctx context.Context, params SetBusinessAccountBio) (bool, error) {
req := NewRequest[bool]("setBusinessAccountBio", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// SetBusinessAccountProfilePhoto holds parameters for the setBusinessAccountProfilePhoto method.
@@ -306,7 +306,7 @@ type SetBusinessAccountProfilePhoto struct {
// See https://core.telegram.org/bots/api#setbusinessaccountprofilephoto
func (api *API) SetBusinessAccountProfilePhoto(params SetBusinessAccountProfilePhoto) (bool, error) {
req := NewRequest[bool]("setBusinessAccountProfilePhoto", params)
return req.Do(api)
return api.Do(req)
}
// SetBusinessAccountProfilePhotoWithContext is the context-aware variant of SetBusinessAccountProfilePhoto.
@@ -315,7 +315,7 @@ func (api *API) SetBusinessAccountProfilePhoto(params SetBusinessAccountProfileP
// See https://core.telegram.org/bots/api#setbusinessaccountprofilephoto
func (api *API) SetBusinessAccountProfilePhotoWithContext(ctx context.Context, params SetBusinessAccountProfilePhoto) (bool, error) {
req := NewRequest[bool]("setBusinessAccountProfilePhoto", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// RemoveBusinessAccountProfilePhoto holds parameters for the removeBusinessAccountProfilePhoto method.
@@ -336,7 +336,7 @@ type RemoveBusinessAccountProfilePhoto struct {
// See https://core.telegram.org/bots/api#removebusinessaccountprofilephoto
func (api *API) RemoveBusinessAccountProfilePhoto(params RemoveBusinessAccountProfilePhoto) (bool, error) {
req := NewRequest[bool]("removeBusinessAccountProfilePhoto", params)
return req.Do(api)
return api.Do(req)
}
// RemoveBusinessAccountProfilePhotoWithContext is the context-aware variant of RemoveBusinessAccountProfilePhoto.
@@ -345,7 +345,7 @@ func (api *API) RemoveBusinessAccountProfilePhoto(params RemoveBusinessAccountPr
// See https://core.telegram.org/bots/api#removebusinessaccountprofilephoto
func (api *API) RemoveBusinessAccountProfilePhotoWithContext(ctx context.Context, params RemoveBusinessAccountProfilePhoto) (bool, error) {
req := NewRequest[bool]("removeBusinessAccountProfilePhoto", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// SetBusinessAccountGiftSettings holds parameters for the setBusinessAccountGiftSettings method.
@@ -367,7 +367,7 @@ type SetBusinessAccountGiftSettings struct {
// See https://core.telegram.org/bots/api#setbusinessaccountgiftsettings
func (api *API) SetBusinessAccountGiftSettings(params SetBusinessAccountGiftSettings) (bool, error) {
req := NewRequest[bool]("setBusinessAccountGiftSettings", params)
return req.Do(api)
return api.Do(req)
}
// SetBusinessAccountGiftSettingsWithContext is the context-aware variant of SetBusinessAccountGiftSettings.
@@ -376,7 +376,7 @@ func (api *API) SetBusinessAccountGiftSettings(params SetBusinessAccountGiftSett
// See https://core.telegram.org/bots/api#setbusinessaccountgiftsettings
func (api *API) SetBusinessAccountGiftSettingsWithContext(ctx context.Context, params SetBusinessAccountGiftSettings) (bool, error) {
req := NewRequest[bool]("setBusinessAccountGiftSettings", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// GetBusinessAccountStarBalance holds parameters for the getBusinessAccountStarBalance method.
@@ -392,7 +392,7 @@ type GetBusinessAccountStarBalance struct {
// See https://core.telegram.org/bots/api#getbusinessaccountstarbalance
func (api *API) GetBusinessAccountStarBalance(params GetBusinessAccountStarBalance) (StarAmount, error) {
req := NewRequest[StarAmount]("getBusinessAccountStarBalance", params)
return req.Do(api)
return api.Do(req)
}
// GetBusinessAccountStarBalanceWithContext is the context-aware variant of GetBusinessAccountStarBalance.
@@ -401,7 +401,7 @@ func (api *API) GetBusinessAccountStarBalance(params GetBusinessAccountStarBalan
// See https://core.telegram.org/bots/api#getbusinessaccountstarbalance
func (api *API) GetBusinessAccountStarBalanceWithContext(ctx context.Context, params GetBusinessAccountStarBalance) (StarAmount, error) {
req := NewRequest[StarAmount]("getBusinessAccountStarBalance", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// TransferBusinessAccountStars holds parameters for the transferBusinessAccountStars method.
@@ -420,7 +420,7 @@ type TransferBusinessAccountStars struct {
// See https://core.telegram.org/bots/api#transferbusinessaccountstars
func (api *API) TransferBusinessAccountStars(params TransferBusinessAccountStars) (bool, error) {
req := NewRequest[bool]("transferBusinessAccountStars", params)
return req.Do(api)
return api.Do(req)
}
// TransferBusinessAccountStarsWithContext is the context-aware variant of TransferBusinessAccountStars.
@@ -429,7 +429,7 @@ func (api *API) TransferBusinessAccountStars(params TransferBusinessAccountStars
// See https://core.telegram.org/bots/api#transferbusinessaccountstars
func (api *API) TransferBusinessAccountStarsWithContext(ctx context.Context, params TransferBusinessAccountStars) (bool, error) {
req := NewRequest[bool]("transferBusinessAccountStars", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// GetBusinessAccountGifts holds parameters for the getBusinessAccountGifts method.
@@ -470,7 +470,7 @@ type GetBusinessAccountGifts struct {
// See https://core.telegram.org/bots/api#getbusinessaccountgifts
func (api *API) GetBusinessAccountGifts(params GetBusinessAccountGifts) (OwnedGifts, error) {
req := NewRequest[OwnedGifts]("getBusinessAccountGifts", params)
return req.Do(api)
return api.Do(req)
}
// GetBusinessAccountGiftsWithContext is the context-aware variant of GetBusinessAccountGifts.
@@ -479,7 +479,7 @@ func (api *API) GetBusinessAccountGifts(params GetBusinessAccountGifts) (OwnedGi
// See https://core.telegram.org/bots/api#getbusinessaccountgifts
func (api *API) GetBusinessAccountGiftsWithContext(ctx context.Context, params GetBusinessAccountGifts) (OwnedGifts, error) {
req := NewRequest[OwnedGifts]("getBusinessAccountGifts", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// ConvertGiftToStars holds parameters for the convertGiftToStars method.
@@ -498,7 +498,7 @@ type ConvertGiftToStars struct {
// See https://core.telegram.org/bots/api#convertgifttostars
func (api *API) ConvertGiftToStars(params ConvertGiftToStars) (bool, error) {
req := NewRequest[bool]("convertGiftToStars", params)
return req.Do(api)
return api.Do(req)
}
// ConvertGiftToStarsWithContext is the context-aware variant of ConvertGiftToStars.
@@ -507,7 +507,7 @@ func (api *API) ConvertGiftToStars(params ConvertGiftToStars) (bool, error) {
// See https://core.telegram.org/bots/api#convertgifttostars
func (api *API) ConvertGiftToStarsWithContext(ctx context.Context, params ConvertGiftToStars) (bool, error) {
req := NewRequest[bool]("convertGiftToStars", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// UpgradeGift holds parameters for the upgradeGift method.
@@ -533,7 +533,7 @@ type UpgradeGift struct {
// See https://core.telegram.org/bots/api#upgradegift
func (api *API) UpgradeGift(params UpgradeGift) (bool, error) {
req := NewRequest[bool]("upgradeGift", params)
return req.Do(api)
return api.Do(req)
}
// UpgradeGiftWithContext is the context-aware variant of UpgradeGift.
@@ -542,7 +542,7 @@ func (api *API) UpgradeGift(params UpgradeGift) (bool, error) {
// See https://core.telegram.org/bots/api#upgradegift
func (api *API) UpgradeGiftWithContext(ctx context.Context, params UpgradeGift) (bool, error) {
req := NewRequest[bool]("upgradeGift", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// TransferGift holds parameters for the transferGift method.
@@ -567,7 +567,7 @@ type TransferGift struct {
// See https://core.telegram.org/bots/api#transfergift
func (api *API) TransferGift(params TransferGift) (bool, error) {
req := NewRequest[bool]("transferGift", params)
return req.Do(api)
return api.Do(req)
}
// TransferGiftWithContext is the context-aware variant of TransferGift.
@@ -576,7 +576,7 @@ func (api *API) TransferGift(params TransferGift) (bool, error) {
// See https://core.telegram.org/bots/api#transfergift
func (api *API) TransferGiftWithContext(ctx context.Context, params TransferGift) (bool, error) {
req := NewRequest[bool]("transferGift", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// PostStory holds parameters for the postStory method.
@@ -614,7 +614,7 @@ type PostStory struct {
// See https://core.telegram.org/bots/api#poststory
func (api *API) PostStory(params PostStory) (Story, error) {
req := NewRequest[Story]("postStory", params)
return req.Do(api)
return api.Do(req)
}
// PostStoryWithContext is the context-aware variant of PostStory.
@@ -623,7 +623,7 @@ func (api *API) PostStory(params PostStory) (Story, error) {
// See https://core.telegram.org/bots/api#poststory
func (api *API) PostStoryWithContext(ctx context.Context, params PostStory) (Story, error) {
req := NewRequest[Story]("postStory", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// RepostStory holds parameters for the repostStory method.
@@ -652,7 +652,7 @@ type RepostStory struct {
// See https://core.telegram.org/bots/api#repoststory
func (api *API) RepostStory(params RepostStory) (Story, error) {
req := NewRequest[Story]("repostStory", params)
return req.Do(api)
return api.Do(req)
}
// RepostStoryWithContext is the context-aware variant of RepostStory.
@@ -661,7 +661,7 @@ func (api *API) RepostStory(params RepostStory) (Story, error) {
// See https://core.telegram.org/bots/api#repoststory
func (api *API) RepostStoryWithContext(ctx context.Context, params RepostStory) (Story, error) {
req := NewRequest[Story]("repostStory", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// EditStory holds parameters for the editStory method.
@@ -693,7 +693,7 @@ type EditStory struct {
// See https://core.telegram.org/bots/api#editstory
func (api *API) EditStory(params EditStory) (Story, error) {
req := NewRequest[Story]("editStory", params)
return req.Do(api)
return api.Do(req)
}
// EditStoryWithContext is the context-aware variant of EditStory.
@@ -702,7 +702,7 @@ func (api *API) EditStory(params EditStory) (Story, error) {
// See https://core.telegram.org/bots/api#editstory
func (api *API) EditStoryWithContext(ctx context.Context, params EditStory) (Story, error) {
req := NewRequest[Story]("editStory", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// DeleteStory holds parameters for the deleteStory method.
@@ -721,7 +721,7 @@ type DeleteStory struct {
// See https://core.telegram.org/bots/api#deletestory
func (api *API) DeleteStory(params DeleteStory) (bool, error) {
req := NewRequest[bool]("deleteStory", params)
return req.Do(api)
return api.Do(req)
}
// DeleteStoryWithContext is the context-aware variant of DeleteStory.
@@ -730,5 +730,5 @@ func (api *API) DeleteStory(params DeleteStory) (bool, error) {
// See https://core.telegram.org/bots/api#deletestory
func (api *API) DeleteStoryWithContext(ctx context.Context, params DeleteStory) (bool, error) {
req := NewRequest[bool]("deleteStory", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}