(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
+71 -69
View File
@@ -27,7 +27,7 @@ type BanChatMember struct {
// See https://core.telegram.org/bots/api#banchatmember
func (api *API) BanChatMember(params BanChatMember) (bool, error) {
req := NewRequestWithChatID[bool]("banChatMember", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// BanChatMemberWithContext is the context-aware variant of BanChatMember.
@@ -36,7 +36,7 @@ func (api *API) BanChatMember(params BanChatMember) (bool, error) {
// See https://core.telegram.org/bots/api#banchatmember
func (api *API) BanChatMemberWithContext(ctx context.Context, params BanChatMember) (bool, error) {
req := NewRequestWithChatID[bool]("banChatMember", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// UnbanChatMember holds parameters for the unbanChatMember method.
@@ -58,7 +58,7 @@ type UnbanChatMember struct {
// See https://core.telegram.org/bots/api#unbanchatmember
func (api *API) UnbanChatMember(params UnbanChatMember) (bool, error) {
req := NewRequestWithChatID[bool]("unbanChatMember", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// UnbanChatMemberWithContext is the context-aware variant of UnbanChatMember.
@@ -67,7 +67,7 @@ func (api *API) UnbanChatMember(params UnbanChatMember) (bool, error) {
// See https://core.telegram.org/bots/api#unbanchatmember
func (api *API) UnbanChatMemberWithContext(ctx context.Context, params UnbanChatMember) (bool, error) {
req := NewRequestWithChatID[bool]("unbanChatMember", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// RestrictChatMember holds parameters for the restrictChatMember method.
@@ -99,7 +99,7 @@ type RestrictChatMember struct {
// See https://core.telegram.org/bots/api#restrictchatmember
func (api *API) RestrictChatMember(params RestrictChatMember) (bool, error) {
req := NewRequestWithChatID[bool]("restrictChatMember", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// RestrictChatMemberWithContext is the context-aware variant of RestrictChatMember.
@@ -108,7 +108,7 @@ func (api *API) RestrictChatMember(params RestrictChatMember) (bool, error) {
// See https://core.telegram.org/bots/api#restrictchatmember
func (api *API) RestrictChatMemberWithContext(ctx context.Context, params RestrictChatMember) (bool, error) {
req := NewRequestWithChatID[bool]("restrictChatMember", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// PromoteChatMember holds parameters for the promoteChatMember method.
@@ -167,6 +167,8 @@ type PromoteChatMember struct {
// CanManageTags Optional. Pass True if the administrator can edit the tags of regular members; for groups
// and supergroups only
CanManageTags bool `json:"can_manage_tags,omitempty"` // Since: Bot API 9.5
// CanSendWelcomeMessages allows the administrator to manage chat welcome messages or send them as a bot.
CanSendWelcomeMessages bool `json:"can_send_welcome_messages,omitempty"` // Since: Bot API 10.3
}
// PromoteChatMember promotes or demotes a user in a chat.
@@ -175,7 +177,7 @@ type PromoteChatMember struct {
// See https://core.telegram.org/bots/api#promotechatmember
func (api *API) PromoteChatMember(params PromoteChatMember) (bool, error) {
req := NewRequestWithChatID[bool]("promoteChatMember", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// PromoteChatMemberWithContext is the context-aware variant of PromoteChatMember.
@@ -184,7 +186,7 @@ func (api *API) PromoteChatMember(params PromoteChatMember) (bool, error) {
// See https://core.telegram.org/bots/api#promotechatmember
func (api *API) PromoteChatMemberWithContext(ctx context.Context, params PromoteChatMember) (bool, error) {
req := NewRequestWithChatID[bool]("promoteChatMember", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// SetChatAdministratorCustomTitle holds parameters for the setChatAdministratorCustomTitle method.
@@ -206,7 +208,7 @@ type SetChatAdministratorCustomTitle struct {
// See https://core.telegram.org/bots/api#setchatadministratorcustomtitle
func (api *API) SetChatAdministratorCustomTitle(params SetChatAdministratorCustomTitle) (bool, error) {
req := NewRequestWithChatID[bool]("setChatAdministratorCustomTitle", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// SetChatAdministratorCustomTitleWithContext is the context-aware variant of SetChatAdministratorCustomTitle.
@@ -215,7 +217,7 @@ func (api *API) SetChatAdministratorCustomTitle(params SetChatAdministratorCusto
// See https://core.telegram.org/bots/api#setchatadministratorcustomtitle
func (api *API) SetChatAdministratorCustomTitleWithContext(ctx context.Context, params SetChatAdministratorCustomTitle) (bool, error) {
req := NewRequestWithChatID[bool]("setChatAdministratorCustomTitle", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// SetChatMemberTag holds parameters for the setChatMemberTag method.
@@ -237,7 +239,7 @@ type SetChatMemberTag struct {
// See https://core.telegram.org/bots/api#setchatmembertag
func (api *API) SetChatMemberTag(params SetChatMemberTag) (bool, error) {
req := NewRequestWithChatID[bool]("setChatMemberTag", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// SetChatMemberTagWithContext is the context-aware variant of SetChatMemberTag.
@@ -246,7 +248,7 @@ func (api *API) SetChatMemberTag(params SetChatMemberTag) (bool, error) {
// See https://core.telegram.org/bots/api#setchatmembertag
func (api *API) SetChatMemberTagWithContext(ctx context.Context, params SetChatMemberTag) (bool, error) {
req := NewRequestWithChatID[bool]("setChatMemberTag", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// BanChatSenderChat holds parameters for the banChatSenderChat method.
@@ -266,7 +268,7 @@ type BanChatSenderChat struct {
// See https://core.telegram.org/bots/api#banchatsenderchat
func (api *API) BanChatSenderChat(params BanChatSenderChat) (bool, error) {
req := NewRequestWithChatID[bool]("banChatSenderChat", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// BanChatSenderChatWithContext is the context-aware variant of BanChatSenderChat.
@@ -275,7 +277,7 @@ func (api *API) BanChatSenderChat(params BanChatSenderChat) (bool, error) {
// See https://core.telegram.org/bots/api#banchatsenderchat
func (api *API) BanChatSenderChatWithContext(ctx context.Context, params BanChatSenderChat) (bool, error) {
req := NewRequestWithChatID[bool]("banChatSenderChat", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// UnbanChatSenderChat holds parameters for the unbanChatSenderChat method.
@@ -295,7 +297,7 @@ type UnbanChatSenderChat struct {
// See https://core.telegram.org/bots/api#unbanchatsenderchat
func (api *API) UnbanChatSenderChat(params UnbanChatSenderChat) (bool, error) {
req := NewRequestWithChatID[bool]("unbanChatSenderChat", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// UnbanChatSenderChatWithContext is the context-aware variant of UnbanChatSenderChat.
@@ -304,7 +306,7 @@ func (api *API) UnbanChatSenderChat(params UnbanChatSenderChat) (bool, error) {
// See https://core.telegram.org/bots/api#unbanchatsenderchat
func (api *API) UnbanChatSenderChatWithContext(ctx context.Context, params UnbanChatSenderChat) (bool, error) {
req := NewRequestWithChatID[bool]("unbanChatSenderChat", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// SetChatPermissions holds parameters for the setChatPermissions method.
@@ -330,7 +332,7 @@ type SetChatPermissions struct {
// See https://core.telegram.org/bots/api#setchatpermissions
func (api *API) SetChatPermissions(params SetChatPermissions) (bool, error) {
req := NewRequestWithChatID[bool]("setChatPermissions", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// SetChatPermissionsWithContext is the context-aware variant of SetChatPermissions.
@@ -339,7 +341,7 @@ func (api *API) SetChatPermissions(params SetChatPermissions) (bool, error) {
// See https://core.telegram.org/bots/api#setchatpermissions
func (api *API) SetChatPermissionsWithContext(ctx context.Context, params SetChatPermissions) (bool, error) {
req := NewRequestWithChatID[bool]("setChatPermissions", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// ExportChatInviteLink holds parameters for the exportChatInviteLink method.
@@ -357,7 +359,7 @@ type ExportChatInviteLink struct {
// See https://core.telegram.org/bots/api#exportchatinvitelink
func (api *API) ExportChatInviteLink(params ExportChatInviteLink) (string, error) {
req := NewRequestWithChatID[string]("exportChatInviteLink", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// ExportChatInviteLinkWithContext is the context-aware variant of ExportChatInviteLink.
@@ -366,7 +368,7 @@ func (api *API) ExportChatInviteLink(params ExportChatInviteLink) (string, error
// See https://core.telegram.org/bots/api#exportchatinvitelink
func (api *API) ExportChatInviteLinkWithContext(ctx context.Context, params ExportChatInviteLink) (string, error) {
req := NewRequestWithChatID[string]("exportChatInviteLink", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// CreateChatInviteLink holds parameters for the createChatInviteLink method.
@@ -394,7 +396,7 @@ type CreateChatInviteLink struct {
// See https://core.telegram.org/bots/api#createchatinvitelink
func (api *API) CreateChatInviteLink(params CreateChatInviteLink) (ChatInviteLink, error) {
req := NewRequestWithChatID[ChatInviteLink]("createChatInviteLink", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// CreateChatInviteLinkWithContext is the context-aware variant of CreateChatInviteLink.
@@ -403,7 +405,7 @@ func (api *API) CreateChatInviteLink(params CreateChatInviteLink) (ChatInviteLin
// See https://core.telegram.org/bots/api#createchatinvitelink
func (api *API) CreateChatInviteLinkWithContext(ctx context.Context, params CreateChatInviteLink) (ChatInviteLink, error) {
req := NewRequestWithChatID[ChatInviteLink]("createChatInviteLink", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// EditChatInviteLink holds parameters for the editChatInviteLink method.
@@ -434,7 +436,7 @@ type EditChatInviteLink struct {
// See https://core.telegram.org/bots/api#editchatinvitelink
func (api *API) EditChatInviteLink(params EditChatInviteLink) (ChatInviteLink, error) {
req := NewRequestWithChatID[ChatInviteLink]("editChatInviteLink", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// EditChatInviteLinkWithContext is the context-aware variant of EditChatInviteLink.
@@ -443,7 +445,7 @@ func (api *API) EditChatInviteLink(params EditChatInviteLink) (ChatInviteLink, e
// See https://core.telegram.org/bots/api#editchatinvitelink
func (api *API) EditChatInviteLinkWithContext(ctx context.Context, params EditChatInviteLink) (ChatInviteLink, error) {
req := NewRequestWithChatID[ChatInviteLink]("editChatInviteLink", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// CreateChatSubscriptionInviteLink holds parameters for the createChatSubscriptionInviteLink method.
@@ -469,7 +471,7 @@ type CreateChatSubscriptionInviteLink struct {
// See https://core.telegram.org/bots/api#createchatsubscriptioninvitelink
func (api *API) CreateChatSubscriptionInviteLink(params CreateChatSubscriptionInviteLink) (ChatInviteLink, error) {
req := NewRequestWithChatID[ChatInviteLink]("createChatSubscriptionInviteLink", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// CreateChatSubscriptionInviteLinkWithContext is the context-aware variant of CreateChatSubscriptionInviteLink.
@@ -478,7 +480,7 @@ func (api *API) CreateChatSubscriptionInviteLink(params CreateChatSubscriptionIn
// See https://core.telegram.org/bots/api#createchatsubscriptioninvitelink
func (api *API) CreateChatSubscriptionInviteLinkWithContext(ctx context.Context, params CreateChatSubscriptionInviteLink) (ChatInviteLink, error) {
req := NewRequestWithChatID[ChatInviteLink]("createChatSubscriptionInviteLink", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// EditChatSubscriptionInviteLink holds parameters for the editChatSubscriptionInviteLink method.
@@ -500,7 +502,7 @@ type EditChatSubscriptionInviteLink struct {
// See https://core.telegram.org/bots/api#editchatsubscriptioninvitelink
func (api *API) EditChatSubscriptionInviteLink(params EditChatSubscriptionInviteLink) (ChatInviteLink, error) {
req := NewRequestWithChatID[ChatInviteLink]("editChatSubscriptionInviteLink", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// EditChatSubscriptionInviteLinkWithContext is the context-aware variant of EditChatSubscriptionInviteLink.
@@ -509,7 +511,7 @@ func (api *API) EditChatSubscriptionInviteLink(params EditChatSubscriptionInvite
// See https://core.telegram.org/bots/api#editchatsubscriptioninvitelink
func (api *API) EditChatSubscriptionInviteLinkWithContext(ctx context.Context, params EditChatSubscriptionInviteLink) (ChatInviteLink, error) {
req := NewRequestWithChatID[ChatInviteLink]("editChatSubscriptionInviteLink", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// RevokeChatInviteLink holds parameters for the revokeChatInviteLink method.
@@ -529,7 +531,7 @@ type RevokeChatInviteLink struct {
// See https://core.telegram.org/bots/api#revokechatinvitelink
func (api *API) RevokeChatInviteLink(params RevokeChatInviteLink) (ChatInviteLink, error) {
req := NewRequestWithChatID[ChatInviteLink]("revokeChatInviteLink", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// RevokeChatInviteLinkWithContext is the context-aware variant of RevokeChatInviteLink.
@@ -538,7 +540,7 @@ func (api *API) RevokeChatInviteLink(params RevokeChatInviteLink) (ChatInviteLin
// See https://core.telegram.org/bots/api#revokechatinvitelink
func (api *API) RevokeChatInviteLinkWithContext(ctx context.Context, params RevokeChatInviteLink) (ChatInviteLink, error) {
req := NewRequestWithChatID[ChatInviteLink]("revokeChatInviteLink", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// ApproveChatJoinRequest holds parameters for the approveChatJoinRequest method.
@@ -558,7 +560,7 @@ type ApproveChatJoinRequest struct {
// See https://core.telegram.org/bots/api#approvechatjoinrequest
func (api *API) ApproveChatJoinRequest(params ApproveChatJoinRequest) (bool, error) {
req := NewRequestWithChatID[bool]("approveChatJoinRequest", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// ApproveChatJoinRequestWithContext is the context-aware variant of ApproveChatJoinRequest.
@@ -567,7 +569,7 @@ func (api *API) ApproveChatJoinRequest(params ApproveChatJoinRequest) (bool, err
// See https://core.telegram.org/bots/api#approvechatjoinrequest
func (api *API) ApproveChatJoinRequestWithContext(ctx context.Context, params ApproveChatJoinRequest) (bool, error) {
req := NewRequestWithChatID[bool]("approveChatJoinRequest", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// DeclineChatJoinRequest holds parameters for the declineChatJoinRequest method.
@@ -587,7 +589,7 @@ type DeclineChatJoinRequest struct {
// See https://core.telegram.org/bots/api#declinechatjoinrequest
func (api *API) DeclineChatJoinRequest(params DeclineChatJoinRequest) (bool, error) {
req := NewRequestWithChatID[bool]("declineChatJoinRequest", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// DeclineChatJoinRequestWithContext is the context-aware variant of DeclineChatJoinRequest.
@@ -596,7 +598,7 @@ func (api *API) DeclineChatJoinRequest(params DeclineChatJoinRequest) (bool, err
// See https://core.telegram.org/bots/api#declinechatjoinrequest
func (api *API) DeclineChatJoinRequestWithContext(ctx context.Context, params DeclineChatJoinRequest) (bool, error) {
req := NewRequestWithChatID[bool]("declineChatJoinRequest", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// ChatJoinRequestQueryResult is the verdict passed to answerChatJoinRequestQuery.
@@ -628,7 +630,7 @@ type AnswerChatJoinRequestQuery struct {
// See https://core.telegram.org/bots/api#answerchatjoinrequestquery
func (api *API) AnswerChatJoinRequestQuery(params AnswerChatJoinRequestQuery) (bool, error) {
req := NewRequest[bool]("answerChatJoinRequestQuery", params)
return req.Do(api)
return api.Do(req)
}
// AnswerChatJoinRequestQueryWithContext is the context-aware variant of AnswerChatJoinRequestQuery.
@@ -637,7 +639,7 @@ func (api *API) AnswerChatJoinRequestQuery(params AnswerChatJoinRequestQuery) (b
// See https://core.telegram.org/bots/api#answerchatjoinrequestquery
func (api *API) AnswerChatJoinRequestQueryWithContext(ctx context.Context, params AnswerChatJoinRequestQuery) (bool, error) {
req := NewRequest[bool]("answerChatJoinRequestQuery", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// SendChatJoinRequestWebApp holds parameters for the sendChatJoinRequestWebApp method.
@@ -658,7 +660,7 @@ type SendChatJoinRequestWebApp struct {
// See https://core.telegram.org/bots/api#sendchatjoinrequestwebapp
func (api *API) SendChatJoinRequestWebApp(params SendChatJoinRequestWebApp) (bool, error) {
req := NewRequest[bool]("sendChatJoinRequestWebApp", params)
return req.Do(api)
return api.Do(req)
}
// SendChatJoinRequestWebAppWithContext is the context-aware variant of SendChatJoinRequestWebApp.
@@ -667,7 +669,7 @@ func (api *API) SendChatJoinRequestWebApp(params SendChatJoinRequestWebApp) (boo
// See https://core.telegram.org/bots/api#sendchatjoinrequestwebapp
func (api *API) SendChatJoinRequestWebAppWithContext(ctx context.Context, params SendChatJoinRequestWebApp) (bool, error) {
req := NewRequest[bool]("sendChatJoinRequestWebApp", params)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// SetChatPhoto holds parameters for the setChatPhoto method.
@@ -699,7 +701,7 @@ func (api *API) SetChatPhotoWithContext(ctx context.Context, params SetChatPhoto
_ = uploader.Close()
}()
req := NewUploaderRequestWithChatID[bool]("setChatPhoto", params, params.ChatID, photo.SetType(UploaderPhotoType))
return req.DoWithContext(ctx, uploader)
return uploader.DoWithContext(ctx, req)
}
// DeleteChatPhoto holds parameters for the deleteChatPhoto method.
@@ -717,7 +719,7 @@ type DeleteChatPhoto struct {
// See https://core.telegram.org/bots/api#deletechatphoto
func (api *API) DeleteChatPhoto(params DeleteChatPhoto) (bool, error) {
req := NewRequestWithChatID[bool]("deleteChatPhoto", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// DeleteChatPhotoWithContext is the context-aware variant of DeleteChatPhoto.
@@ -726,7 +728,7 @@ func (api *API) DeleteChatPhoto(params DeleteChatPhoto) (bool, error) {
// See https://core.telegram.org/bots/api#deletechatphoto
func (api *API) DeleteChatPhotoWithContext(ctx context.Context, params DeleteChatPhoto) (bool, error) {
req := NewRequestWithChatID[bool]("deleteChatPhoto", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// SetChatTitle holds parameters for the setChatTitle method.
@@ -746,7 +748,7 @@ type SetChatTitle struct {
// See https://core.telegram.org/bots/api#setchattitle
func (api *API) SetChatTitle(params SetChatTitle) (bool, error) {
req := NewRequestWithChatID[bool]("setChatTitle", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// SetChatTitleWithContext is the context-aware variant of SetChatTitle.
@@ -755,7 +757,7 @@ func (api *API) SetChatTitle(params SetChatTitle) (bool, error) {
// See https://core.telegram.org/bots/api#setchattitle
func (api *API) SetChatTitleWithContext(ctx context.Context, params SetChatTitle) (bool, error) {
req := NewRequestWithChatID[bool]("setChatTitle", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// SetChatDescription holds parameters for the setChatDescription method.
@@ -775,7 +777,7 @@ type SetChatDescription struct {
// See https://core.telegram.org/bots/api#setchatdescription
func (api *API) SetChatDescription(params SetChatDescription) (bool, error) {
req := NewRequestWithChatID[bool]("setChatDescription", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// SetChatDescriptionWithContext is the context-aware variant of SetChatDescription.
@@ -784,7 +786,7 @@ func (api *API) SetChatDescription(params SetChatDescription) (bool, error) {
// See https://core.telegram.org/bots/api#setchatdescription
func (api *API) SetChatDescriptionWithContext(ctx context.Context, params SetChatDescription) (bool, error) {
req := NewRequestWithChatID[bool]("setChatDescription", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// PinChatMessage holds parameters for the pinChatMessage method.
@@ -810,7 +812,7 @@ type PinChatMessage struct {
// See https://core.telegram.org/bots/api#pinchatmessage
func (api *API) PinChatMessage(params PinChatMessage) (bool, error) {
req := NewRequestWithChatID[bool]("pinChatMessage", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// PinChatMessageWithContext is the context-aware variant of PinChatMessage.
@@ -819,7 +821,7 @@ func (api *API) PinChatMessage(params PinChatMessage) (bool, error) {
// See https://core.telegram.org/bots/api#pinchatmessage
func (api *API) PinChatMessageWithContext(ctx context.Context, params PinChatMessage) (bool, error) {
req := NewRequestWithChatID[bool]("pinChatMessage", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// UnpinChatMessage holds parameters for the unpinChatMessage method.
@@ -843,7 +845,7 @@ type UnpinChatMessage struct {
// See https://core.telegram.org/bots/api#unpinchatmessage
func (api *API) UnpinChatMessage(params UnpinChatMessage) (bool, error) {
req := NewRequestWithChatID[bool]("unpinChatMessage", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// UnpinChatMessageWithContext is the context-aware variant of UnpinChatMessage.
@@ -852,7 +854,7 @@ func (api *API) UnpinChatMessage(params UnpinChatMessage) (bool, error) {
// See https://core.telegram.org/bots/api#unpinchatmessage
func (api *API) UnpinChatMessageWithContext(ctx context.Context, params UnpinChatMessage) (bool, error) {
req := NewRequestWithChatID[bool]("unpinChatMessage", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// UnpinAllChatMessages holds parameters for the unpinAllChatMessages method.
@@ -870,7 +872,7 @@ type UnpinAllChatMessages struct {
// See https://core.telegram.org/bots/api#unpinallchatmessages
func (api *API) UnpinAllChatMessages(params UnpinAllChatMessages) (bool, error) {
req := NewRequestWithChatID[bool]("unpinAllChatMessages", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// UnpinAllChatMessagesWithContext is the context-aware variant of UnpinAllChatMessages.
@@ -879,7 +881,7 @@ func (api *API) UnpinAllChatMessages(params UnpinAllChatMessages) (bool, error)
// See https://core.telegram.org/bots/api#unpinallchatmessages
func (api *API) UnpinAllChatMessagesWithContext(ctx context.Context, params UnpinAllChatMessages) (bool, error) {
req := NewRequestWithChatID[bool]("unpinAllChatMessages", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// LeaveChat holds parameters for the leaveChat method.
@@ -898,7 +900,7 @@ type LeaveChat struct {
// See https://core.telegram.org/bots/api#leavechat
func (api *API) LeaveChat(params LeaveChat) (bool, error) {
req := NewRequestWithChatID[bool]("leaveChat", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// LeaveChatWithContext is the context-aware variant of LeaveChat.
@@ -907,7 +909,7 @@ func (api *API) LeaveChat(params LeaveChat) (bool, error) {
// See https://core.telegram.org/bots/api#leavechat
func (api *API) LeaveChatWithContext(ctx context.Context, params LeaveChat) (bool, error) {
req := NewRequestWithChatID[bool]("leaveChat", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// GetChat holds parameters for the getChat method.
@@ -924,7 +926,7 @@ type GetChat struct {
// See https://core.telegram.org/bots/api#getchat
func (api *API) GetChat(params GetChat) (ChatFullInfo, error) {
req := NewRequestWithChatID[ChatFullInfo]("getChat", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// GetChatWithContext is the context-aware variant of GetChat.
@@ -933,7 +935,7 @@ func (api *API) GetChat(params GetChat) (ChatFullInfo, error) {
// See https://core.telegram.org/bots/api#getchat
func (api *API) GetChatWithContext(ctx context.Context, params GetChat) (ChatFullInfo, error) {
req := NewRequestWithChatID[ChatFullInfo]("getChat", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// GetChatAdministrators holds parameters for the getChatAdministrators method.
@@ -953,7 +955,7 @@ type GetChatAdministrators struct {
// See https://core.telegram.org/bots/api#getchatadministrators
func (api *API) GetChatAdministrators(params GetChatAdministrators) ([]ChatMember, error) {
req := NewRequestWithChatID[[]ChatMember]("getChatAdministrators", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// GetChatAdministratorsWithContext is the context-aware variant of GetChatAdministrators.
@@ -962,7 +964,7 @@ func (api *API) GetChatAdministrators(params GetChatAdministrators) ([]ChatMembe
// See https://core.telegram.org/bots/api#getchatadministrators
func (api *API) GetChatAdministratorsWithContext(ctx context.Context, params GetChatAdministrators) ([]ChatMember, error) {
req := NewRequestWithChatID[[]ChatMember]("getChatAdministrators", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// GetChatMemberCount holds parameters for the getChatMemberCount method.
@@ -979,7 +981,7 @@ type GetChatMemberCount struct {
// See https://core.telegram.org/bots/api#getchatmembercount
func (api *API) GetChatMemberCount(params GetChatMemberCount) (int, error) {
req := NewRequestWithChatID[int]("getChatMemberCount", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// GetChatMemberCountWithContext is the context-aware variant of GetChatMemberCount.
@@ -988,7 +990,7 @@ func (api *API) GetChatMemberCount(params GetChatMemberCount) (int, error) {
// See https://core.telegram.org/bots/api#getchatmembercount
func (api *API) GetChatMemberCountWithContext(ctx context.Context, params GetChatMemberCount) (int, error) {
req := NewRequestWithChatID[int]("getChatMemberCount", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// GetChatMember holds parameters for the getChatMember method.
@@ -1007,7 +1009,7 @@ type GetChatMember struct {
// See https://core.telegram.org/bots/api#getchatmember
func (api *API) GetChatMember(params GetChatMember) (ChatMember, error) {
req := NewRequestWithChatID[ChatMember]("getChatMember", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// GetChatMemberWithContext is the context-aware variant of GetChatMember.
@@ -1016,7 +1018,7 @@ func (api *API) GetChatMember(params GetChatMember) (ChatMember, error) {
// See https://core.telegram.org/bots/api#getchatmember
func (api *API) GetChatMemberWithContext(ctx context.Context, params GetChatMember) (ChatMember, error) {
req := NewRequestWithChatID[ChatMember]("getChatMember", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// SetChatStickerSet holds parameters for the setChatStickerSet method.
@@ -1036,7 +1038,7 @@ type SetChatStickerSet struct {
// See https://core.telegram.org/bots/api#setchatstickerset
func (api *API) SetChatStickerSet(params SetChatStickerSet) (bool, error) {
req := NewRequestWithChatID[bool]("setChatStickerSet", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// SetChatStickerSetWithContext is the context-aware variant of SetChatStickerSet.
@@ -1045,7 +1047,7 @@ func (api *API) SetChatStickerSet(params SetChatStickerSet) (bool, error) {
// See https://core.telegram.org/bots/api#setchatstickerset
func (api *API) SetChatStickerSetWithContext(ctx context.Context, params SetChatStickerSet) (bool, error) {
req := NewRequestWithChatID[bool]("setChatStickerSet", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// DeleteChatStickerSet holds parameters for the deleteChatStickerSet method.
@@ -1063,7 +1065,7 @@ type DeleteChatStickerSet struct {
// See https://core.telegram.org/bots/api#deletechatstickerset
func (api *API) DeleteChatStickerSet(params DeleteChatStickerSet) (bool, error) {
req := NewRequestWithChatID[bool]("deleteChatStickerSet", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// DeleteChatStickerSetWithContext is the context-aware variant of DeleteChatStickerSet.
@@ -1072,7 +1074,7 @@ func (api *API) DeleteChatStickerSet(params DeleteChatStickerSet) (bool, error)
// See https://core.telegram.org/bots/api#deletechatstickerset
func (api *API) DeleteChatStickerSetWithContext(ctx context.Context, params DeleteChatStickerSet) (bool, error) {
req := NewRequestWithChatID[bool]("deleteChatStickerSet", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// GetUserChatBoosts holds parameters for the getUserChatBoosts method.
@@ -1090,7 +1092,7 @@ type GetUserChatBoosts struct {
// See https://core.telegram.org/bots/api#getuserchatboosts
func (api *API) GetUserChatBoosts(params GetUserChatBoosts) (UserChatBoosts, error) {
req := NewRequestWithChatID[UserChatBoosts]("getUserChatBoosts", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// GetUserChatBoostsWithContext is the context-aware variant of GetUserChatBoosts.
@@ -1099,7 +1101,7 @@ func (api *API) GetUserChatBoosts(params GetUserChatBoosts) (UserChatBoosts, err
// See https://core.telegram.org/bots/api#getuserchatboosts
func (api *API) GetUserChatBoostsWithContext(ctx context.Context, params GetUserChatBoosts) (UserChatBoosts, error) {
req := NewRequestWithChatID[UserChatBoosts]("getUserChatBoosts", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}
// GetChatGifts holds parameters for the getChatGifts method.
@@ -1143,7 +1145,7 @@ type GetChatGifts struct {
// See https://core.telegram.org/bots/api#getchatgifts
func (api *API) GetChatGifts(params GetChatGifts) (OwnedGifts, error) {
req := NewRequestWithChatID[OwnedGifts]("getChatGifts", params, params.ChatID)
return req.Do(api)
return api.Do(req)
}
// GetChatGiftsWithContext is the context-aware variant of GetChatGifts.
@@ -1152,5 +1154,5 @@ func (api *API) GetChatGifts(params GetChatGifts) (OwnedGifts, error) {
// See https://core.telegram.org/bots/api#getchatgifts
func (api *API) GetChatGiftsWithContext(ctx context.Context, params GetChatGifts) (OwnedGifts, error) {
req := NewRequestWithChatID[OwnedGifts]("getChatGifts", params, params.ChatID)
return req.DoWithContext(ctx, api)
return api.DoWithContext(ctx, req)
}