(fix): finalize v2 contracts (tests): cover v2 migration (doc): prepare release guidance
This commit is contained in:
+26
-26
@@ -16,7 +16,7 @@ type BaseForumTopic struct {
|
||||
// See https://core.telegram.org/bots/api#getforumtopiciconstickers
|
||||
func (api *API) GetForumTopicIconStickers() ([]Sticker, error) {
|
||||
req := NewRequest[[]Sticker]("getForumTopicIconStickers", NoParams)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// GetForumTopicIconStickersWithContext is the context-aware variant of GetForumTopicIconStickers.
|
||||
@@ -25,7 +25,7 @@ func (api *API) GetForumTopicIconStickers() ([]Sticker, error) {
|
||||
// See https://core.telegram.org/bots/api#getforumtopiciconstickers
|
||||
func (api *API) GetForumTopicIconStickersWithContext(ctx context.Context) ([]Sticker, error) {
|
||||
req := NewRequest[[]Sticker]("getForumTopicIconStickers", NoParams)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// CreateForumTopic holds parameters for the createForumTopic method.
|
||||
@@ -52,7 +52,7 @@ type CreateForumTopic struct {
|
||||
// See https://core.telegram.org/bots/api#createforumtopic
|
||||
func (api *API) CreateForumTopic(params CreateForumTopic) (ForumTopic, error) {
|
||||
req := NewRequestWithChatID[ForumTopic]("createForumTopic", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// CreateForumTopicWithContext is the context-aware variant of CreateForumTopic.
|
||||
@@ -61,7 +61,7 @@ func (api *API) CreateForumTopic(params CreateForumTopic) (ForumTopic, error) {
|
||||
// See https://core.telegram.org/bots/api#createforumtopic
|
||||
func (api *API) CreateForumTopicWithContext(ctx context.Context, params CreateForumTopic) (ForumTopic, error) {
|
||||
req := NewRequestWithChatID[ForumTopic]("createForumTopic", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// EditForumTopic holds parameters for the editForumTopic method.
|
||||
@@ -84,7 +84,7 @@ type EditForumTopic struct {
|
||||
// See https://core.telegram.org/bots/api#editforumtopic
|
||||
func (api *API) EditForumTopic(params EditForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("editForumTopic", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// EditForumTopicWithContext is the context-aware variant of EditForumTopic.
|
||||
@@ -93,7 +93,7 @@ func (api *API) EditForumTopic(params EditForumTopic) (bool, error) {
|
||||
// See https://core.telegram.org/bots/api#editforumtopic
|
||||
func (api *API) EditForumTopicWithContext(ctx context.Context, params EditForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("editForumTopic", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// CloseForumTopic closes an open forum topic.
|
||||
@@ -102,7 +102,7 @@ func (api *API) EditForumTopicWithContext(ctx context.Context, params EditForumT
|
||||
// See https://core.telegram.org/bots/api#closeforumtopic
|
||||
func (api *API) CloseForumTopic(params BaseForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("closeForumTopic", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// CloseForumTopicWithContext is the context-aware variant of CloseForumTopic.
|
||||
@@ -111,7 +111,7 @@ func (api *API) CloseForumTopic(params BaseForumTopic) (bool, error) {
|
||||
// See https://core.telegram.org/bots/api#closeforumtopic
|
||||
func (api *API) CloseForumTopicWithContext(ctx context.Context, params BaseForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("closeForumTopic", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// ReopenForumTopic reopens a closed forum topic.
|
||||
@@ -120,7 +120,7 @@ func (api *API) CloseForumTopicWithContext(ctx context.Context, params BaseForum
|
||||
// See https://core.telegram.org/bots/api#reopenforumtopic
|
||||
func (api *API) ReopenForumTopic(params BaseForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("reopenForumTopic", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// ReopenForumTopicWithContext is the context-aware variant of ReopenForumTopic.
|
||||
@@ -129,7 +129,7 @@ func (api *API) ReopenForumTopic(params BaseForumTopic) (bool, error) {
|
||||
// See https://core.telegram.org/bots/api#reopenforumtopic
|
||||
func (api *API) ReopenForumTopicWithContext(ctx context.Context, params BaseForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("reopenForumTopic", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// DeleteForumTopic deletes a forum topic.
|
||||
@@ -138,7 +138,7 @@ func (api *API) ReopenForumTopicWithContext(ctx context.Context, params BaseForu
|
||||
// See https://core.telegram.org/bots/api#deleteforumtopic
|
||||
func (api *API) DeleteForumTopic(params BaseForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("deleteForumTopic", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// DeleteForumTopicWithContext is the context-aware variant of DeleteForumTopic.
|
||||
@@ -147,7 +147,7 @@ func (api *API) DeleteForumTopic(params BaseForumTopic) (bool, error) {
|
||||
// See https://core.telegram.org/bots/api#deleteforumtopic
|
||||
func (api *API) DeleteForumTopicWithContext(ctx context.Context, params BaseForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("deleteForumTopic", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// UnpinAllForumTopicMessages clears the list of pinned messages in a forum topic.
|
||||
@@ -156,7 +156,7 @@ func (api *API) DeleteForumTopicWithContext(ctx context.Context, params BaseForu
|
||||
// See https://core.telegram.org/bots/api#unpinallforumtopicmessages
|
||||
func (api *API) UnpinAllForumTopicMessages(params BaseForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("unpinAllForumTopicMessages", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// UnpinAllForumTopicMessagesWithContext is the context-aware variant of UnpinAllForumTopicMessages.
|
||||
@@ -165,7 +165,7 @@ func (api *API) UnpinAllForumTopicMessages(params BaseForumTopic) (bool, error)
|
||||
// See https://core.telegram.org/bots/api#unpinallforumtopicmessages
|
||||
func (api *API) UnpinAllForumTopicMessagesWithContext(ctx context.Context, params BaseForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("unpinAllForumTopicMessages", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// BaseGeneralForumTopic contains common fields for general forum topic operations that require a chat ID.
|
||||
@@ -192,7 +192,7 @@ type EditGeneralForumTopic struct {
|
||||
// See https://core.telegram.org/bots/api#editgeneralforumtopic
|
||||
func (api *API) EditGeneralForumTopic(params EditGeneralForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("editGeneralForumTopic", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// EditGeneralForumTopicWithContext is the context-aware variant of EditGeneralForumTopic.
|
||||
@@ -201,7 +201,7 @@ func (api *API) EditGeneralForumTopic(params EditGeneralForumTopic) (bool, error
|
||||
// See https://core.telegram.org/bots/api#editgeneralforumtopic
|
||||
func (api *API) EditGeneralForumTopicWithContext(ctx context.Context, params EditGeneralForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("editGeneralForumTopic", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// CloseGeneralForumTopic closes the 'General' topic in a forum supergroup.
|
||||
@@ -210,7 +210,7 @@ func (api *API) EditGeneralForumTopicWithContext(ctx context.Context, params Edi
|
||||
// See https://core.telegram.org/bots/api#closegeneralforumtopic
|
||||
func (api *API) CloseGeneralForumTopic(params BaseGeneralForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("closeGeneralForumTopic", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// CloseGeneralForumTopicWithContext is the context-aware variant of CloseGeneralForumTopic.
|
||||
@@ -219,7 +219,7 @@ func (api *API) CloseGeneralForumTopic(params BaseGeneralForumTopic) (bool, erro
|
||||
// See https://core.telegram.org/bots/api#closegeneralforumtopic
|
||||
func (api *API) CloseGeneralForumTopicWithContext(ctx context.Context, params BaseGeneralForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("closeGeneralForumTopic", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// ReopenGeneralForumTopic reopens the 'General' topic in a forum supergroup.
|
||||
@@ -228,7 +228,7 @@ func (api *API) CloseGeneralForumTopicWithContext(ctx context.Context, params Ba
|
||||
// See https://core.telegram.org/bots/api#reopengeneralforumtopic
|
||||
func (api *API) ReopenGeneralForumTopic(params BaseGeneralForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("reopenGeneralForumTopic", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// ReopenGeneralForumTopicWithContext is the context-aware variant of ReopenGeneralForumTopic.
|
||||
@@ -237,7 +237,7 @@ func (api *API) ReopenGeneralForumTopic(params BaseGeneralForumTopic) (bool, err
|
||||
// See https://core.telegram.org/bots/api#reopengeneralforumtopic
|
||||
func (api *API) ReopenGeneralForumTopicWithContext(ctx context.Context, params BaseGeneralForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("reopenGeneralForumTopic", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// HideGeneralForumTopic hides the 'General' topic in a forum supergroup.
|
||||
@@ -246,7 +246,7 @@ func (api *API) ReopenGeneralForumTopicWithContext(ctx context.Context, params B
|
||||
// See https://core.telegram.org/bots/api#hidegeneralforumtopic
|
||||
func (api *API) HideGeneralForumTopic(params BaseGeneralForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("hideGeneralForumTopic", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// HideGeneralForumTopicWithContext is the context-aware variant of HideGeneralForumTopic.
|
||||
@@ -255,7 +255,7 @@ func (api *API) HideGeneralForumTopic(params BaseGeneralForumTopic) (bool, error
|
||||
// See https://core.telegram.org/bots/api#hidegeneralforumtopic
|
||||
func (api *API) HideGeneralForumTopicWithContext(ctx context.Context, params BaseGeneralForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("hideGeneralForumTopic", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// UnhideGeneralForumTopic unhides the 'General' topic in a forum supergroup.
|
||||
@@ -264,7 +264,7 @@ func (api *API) HideGeneralForumTopicWithContext(ctx context.Context, params Bas
|
||||
// See https://core.telegram.org/bots/api#unhidegeneralforumtopic
|
||||
func (api *API) UnhideGeneralForumTopic(params BaseGeneralForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("unhideGeneralForumTopic", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// UnhideGeneralForumTopicWithContext is the context-aware variant of UnhideGeneralForumTopic.
|
||||
@@ -273,7 +273,7 @@ func (api *API) UnhideGeneralForumTopic(params BaseGeneralForumTopic) (bool, err
|
||||
// See https://core.telegram.org/bots/api#unhidegeneralforumtopic
|
||||
func (api *API) UnhideGeneralForumTopicWithContext(ctx context.Context, params BaseGeneralForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("unhideGeneralForumTopic", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
// UnpinAllGeneralForumTopicMessages clears the list of pinned messages in the 'General' topic.
|
||||
@@ -282,7 +282,7 @@ func (api *API) UnhideGeneralForumTopicWithContext(ctx context.Context, params B
|
||||
// See https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
|
||||
func (api *API) UnpinAllGeneralForumTopicMessages(params BaseGeneralForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("unpinAllGeneralForumTopicMessages", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
return api.Do(req)
|
||||
}
|
||||
|
||||
// UnpinAllGeneralForumTopicMessagesWithContext is the context-aware variant of UnpinAllGeneralForumTopicMessages.
|
||||
@@ -291,5 +291,5 @@ func (api *API) UnpinAllGeneralForumTopicMessages(params BaseGeneralForumTopic)
|
||||
// See https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
|
||||
func (api *API) UnpinAllGeneralForumTopicMessagesWithContext(ctx context.Context, params BaseGeneralForumTopic) (bool, error) {
|
||||
req := NewRequestWithChatID[bool]("unpinAllGeneralForumTopicMessages", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
return api.DoWithContext(ctx, req)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user