(new): Bot API 10.0
Golang lint / lint (push) Successful in 2m53s
Golang lint / lint (pull_request) Successful in 2m54s

(doc): Since: Bot API X.Y annotations across all tgapi types and methods
This commit is contained in:
2026-05-19 13:42:10 +03:00
parent affb802a7b
commit 1e26d871b5
29 changed files with 1347 additions and 242 deletions
+31
View File
@@ -3,12 +3,14 @@ package tgapi
import "context"
// BaseForumTopic contains common fields for forum topic operations that require a chat ID and a message thread ID.
// Since: Bot API 6.3
type BaseForumTopic struct {
ChatID int64 `json:"chat_id"`
MessageThreadID int `json:"message_thread_id"`
}
// GetForumTopicIconStickers returns the list of custom emoji that can be used as a forum topic icon.
// Since: Bot API 6.3
// See https://core.telegram.org/bots/api#getforumtopiciconstickers
func (api *API) GetForumTopicIconStickers() ([]Sticker, error) {
req := NewRequest[[]Sticker]("getForumTopicIconStickers", NoParams)
@@ -16,6 +18,7 @@ func (api *API) GetForumTopicIconStickers() ([]Sticker, error) {
}
// GetForumTopicIconStickersWithContext is the context-aware variant of GetForumTopicIconStickers.
// Since: Bot API 6.3
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#getforumtopiciconstickers
func (api *API) GetForumTopicIconStickersWithContext(ctx context.Context) ([]Sticker, error) {
@@ -24,6 +27,7 @@ func (api *API) GetForumTopicIconStickersWithContext(ctx context.Context) ([]Sti
}
// CreateForumTopic holds parameters for the createForumTopic method.
// Since: Bot API 6.3
// See https://core.telegram.org/bots/api#createforumtopic
type CreateForumTopic struct {
ChatID int64 `json:"chat_id"`
@@ -33,6 +37,7 @@ type CreateForumTopic struct {
}
// CreateForumTopic creates a topic in a forum supergroup.
// Since: Bot API 6.3
// Returns the created ForumTopic on success.
// See https://core.telegram.org/bots/api#createforumtopic
func (api *API) CreateForumTopic(params CreateForumTopic) (ForumTopic, error) {
@@ -41,6 +46,7 @@ func (api *API) CreateForumTopic(params CreateForumTopic) (ForumTopic, error) {
}
// CreateForumTopicWithContext is the context-aware variant of CreateForumTopic.
// Since: Bot API 6.3
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#createforumtopic
func (api *API) CreateForumTopicWithContext(ctx context.Context, params CreateForumTopic) (ForumTopic, error) {
@@ -49,6 +55,7 @@ func (api *API) CreateForumTopicWithContext(ctx context.Context, params CreateFo
}
// EditForumTopic holds parameters for the editForumTopic method.
// Since: Bot API 6.3
// See https://core.telegram.org/bots/api#editforumtopic
type EditForumTopic struct {
BaseForumTopic
@@ -57,6 +64,7 @@ type EditForumTopic struct {
}
// EditForumTopic edits name and icon of a forum topic.
// Since: Bot API 6.3
// Returns True on success.
// See https://core.telegram.org/bots/api#editforumtopic
func (api *API) EditForumTopic(params EditForumTopic) (bool, error) {
@@ -65,6 +73,7 @@ func (api *API) EditForumTopic(params EditForumTopic) (bool, error) {
}
// EditForumTopicWithContext is the context-aware variant of EditForumTopic.
// Since: Bot API 6.3
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#editforumtopic
func (api *API) EditForumTopicWithContext(ctx context.Context, params EditForumTopic) (bool, error) {
@@ -73,6 +82,7 @@ func (api *API) EditForumTopicWithContext(ctx context.Context, params EditForumT
}
// CloseForumTopic closes an open forum topic.
// Since: Bot API 6.3
// Returns True on success.
// See https://core.telegram.org/bots/api#closeforumtopic
func (api *API) CloseForumTopic(params BaseForumTopic) (bool, error) {
@@ -81,6 +91,7 @@ func (api *API) CloseForumTopic(params BaseForumTopic) (bool, error) {
}
// CloseForumTopicWithContext is the context-aware variant of CloseForumTopic.
// Since: Bot API 6.3
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#closeforumtopic
func (api *API) CloseForumTopicWithContext(ctx context.Context, params BaseForumTopic) (bool, error) {
@@ -89,6 +100,7 @@ func (api *API) CloseForumTopicWithContext(ctx context.Context, params BaseForum
}
// ReopenForumTopic reopens a closed forum topic.
// Since: Bot API 6.3
// Returns True on success.
// See https://core.telegram.org/bots/api#reopenforumtopic
func (api *API) ReopenForumTopic(params BaseForumTopic) (bool, error) {
@@ -97,6 +109,7 @@ func (api *API) ReopenForumTopic(params BaseForumTopic) (bool, error) {
}
// ReopenForumTopicWithContext is the context-aware variant of ReopenForumTopic.
// Since: Bot API 6.3
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#reopenforumtopic
func (api *API) ReopenForumTopicWithContext(ctx context.Context, params BaseForumTopic) (bool, error) {
@@ -105,6 +118,7 @@ func (api *API) ReopenForumTopicWithContext(ctx context.Context, params BaseForu
}
// DeleteForumTopic deletes a forum topic.
// Since: Bot API 6.3
// Returns True on success.
// See https://core.telegram.org/bots/api#deleteforumtopic
func (api *API) DeleteForumTopic(params BaseForumTopic) (bool, error) {
@@ -113,6 +127,7 @@ func (api *API) DeleteForumTopic(params BaseForumTopic) (bool, error) {
}
// DeleteForumTopicWithContext is the context-aware variant of DeleteForumTopic.
// Since: Bot API 6.3
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#deleteforumtopic
func (api *API) DeleteForumTopicWithContext(ctx context.Context, params BaseForumTopic) (bool, error) {
@@ -121,6 +136,7 @@ func (api *API) DeleteForumTopicWithContext(ctx context.Context, params BaseForu
}
// UnpinAllForumTopicMessages clears the list of pinned messages in a forum topic.
// Since: Bot API 6.3
// Returns True on success.
// See https://core.telegram.org/bots/api#unpinallforumtopicmessages
func (api *API) UnpinAllForumTopicMessages(params BaseForumTopic) (bool, error) {
@@ -129,6 +145,7 @@ func (api *API) UnpinAllForumTopicMessages(params BaseForumTopic) (bool, error)
}
// UnpinAllForumTopicMessagesWithContext is the context-aware variant of UnpinAllForumTopicMessages.
// Since: Bot API 6.3
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#unpinallforumtopicmessages
func (api *API) UnpinAllForumTopicMessagesWithContext(ctx context.Context, params BaseForumTopic) (bool, error) {
@@ -137,11 +154,13 @@ func (api *API) UnpinAllForumTopicMessagesWithContext(ctx context.Context, param
}
// BaseGeneralForumTopic contains common fields for general forum topic operations that require a chat ID.
// Since: Bot API 6.4
type BaseGeneralForumTopic struct {
ChatID int64 `json:"chat_id"`
}
// EditGeneralForumTopic holds parameters for the editGeneralForumTopic method.
// Since: Bot API 6.4
// See https://core.telegram.org/bots/api#editgeneralforumtopic
type EditGeneralForumTopic struct {
ChatID int64 `json:"chat_id"`
@@ -149,6 +168,7 @@ type EditGeneralForumTopic struct {
}
// EditGeneralForumTopic edits the name of the 'General' topic in a forum supergroup.
// Since: Bot API 6.4
// Returns True on success.
// See https://core.telegram.org/bots/api#editgeneralforumtopic
func (api *API) EditGeneralForumTopic(params EditGeneralForumTopic) (bool, error) {
@@ -157,6 +177,7 @@ func (api *API) EditGeneralForumTopic(params EditGeneralForumTopic) (bool, error
}
// EditGeneralForumTopicWithContext is the context-aware variant of EditGeneralForumTopic.
// Since: Bot API 6.4
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#editgeneralforumtopic
func (api *API) EditGeneralForumTopicWithContext(ctx context.Context, params EditGeneralForumTopic) (bool, error) {
@@ -165,6 +186,7 @@ func (api *API) EditGeneralForumTopicWithContext(ctx context.Context, params Edi
}
// CloseGeneralForumTopic closes the 'General' topic in a forum supergroup.
// Since: Bot API 6.4
// Returns True on success.
// See https://core.telegram.org/bots/api#closegeneralforumtopic
func (api *API) CloseGeneralForumTopic(params BaseGeneralForumTopic) (bool, error) {
@@ -173,6 +195,7 @@ func (api *API) CloseGeneralForumTopic(params BaseGeneralForumTopic) (bool, erro
}
// CloseGeneralForumTopicWithContext is the context-aware variant of CloseGeneralForumTopic.
// Since: Bot API 6.4
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#closegeneralforumtopic
func (api *API) CloseGeneralForumTopicWithContext(ctx context.Context, params BaseGeneralForumTopic) (bool, error) {
@@ -181,6 +204,7 @@ func (api *API) CloseGeneralForumTopicWithContext(ctx context.Context, params Ba
}
// ReopenGeneralForumTopic reopens the 'General' topic in a forum supergroup.
// Since: Bot API 6.4
// Returns True on success.
// See https://core.telegram.org/bots/api#reopengeneralforumtopic
func (api *API) ReopenGeneralForumTopic(params BaseGeneralForumTopic) (bool, error) {
@@ -189,6 +213,7 @@ func (api *API) ReopenGeneralForumTopic(params BaseGeneralForumTopic) (bool, err
}
// ReopenGeneralForumTopicWithContext is the context-aware variant of ReopenGeneralForumTopic.
// Since: Bot API 6.4
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#reopengeneralforumtopic
func (api *API) ReopenGeneralForumTopicWithContext(ctx context.Context, params BaseGeneralForumTopic) (bool, error) {
@@ -197,6 +222,7 @@ func (api *API) ReopenGeneralForumTopicWithContext(ctx context.Context, params B
}
// HideGeneralForumTopic hides the 'General' topic in a forum supergroup.
// Since: Bot API 6.4
// Returns True on success.
// See https://core.telegram.org/bots/api#hidegeneralforumtopic
func (api *API) HideGeneralForumTopic(params BaseGeneralForumTopic) (bool, error) {
@@ -205,6 +231,7 @@ func (api *API) HideGeneralForumTopic(params BaseGeneralForumTopic) (bool, error
}
// HideGeneralForumTopicWithContext is the context-aware variant of HideGeneralForumTopic.
// Since: Bot API 6.4
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#hidegeneralforumtopic
func (api *API) HideGeneralForumTopicWithContext(ctx context.Context, params BaseGeneralForumTopic) (bool, error) {
@@ -213,6 +240,7 @@ func (api *API) HideGeneralForumTopicWithContext(ctx context.Context, params Bas
}
// UnhideGeneralForumTopic unhides the 'General' topic in a forum supergroup.
// Since: Bot API 6.4
// Returns True on success.
// See https://core.telegram.org/bots/api#unhidegeneralforumtopic
func (api *API) UnhideGeneralForumTopic(params BaseGeneralForumTopic) (bool, error) {
@@ -221,6 +249,7 @@ func (api *API) UnhideGeneralForumTopic(params BaseGeneralForumTopic) (bool, err
}
// UnhideGeneralForumTopicWithContext is the context-aware variant of UnhideGeneralForumTopic.
// Since: Bot API 6.4
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#unhidegeneralforumtopic
func (api *API) UnhideGeneralForumTopicWithContext(ctx context.Context, params BaseGeneralForumTopic) (bool, error) {
@@ -229,6 +258,7 @@ func (api *API) UnhideGeneralForumTopicWithContext(ctx context.Context, params B
}
// UnpinAllGeneralForumTopicMessages clears the list of pinned messages in the 'General' topic.
// Since: Bot API 6.4
// Returns True on success.
// See https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
func (api *API) UnpinAllGeneralForumTopicMessages(params BaseGeneralForumTopic) (bool, error) {
@@ -237,6 +267,7 @@ func (api *API) UnpinAllGeneralForumTopicMessages(params BaseGeneralForumTopic)
}
// UnpinAllGeneralForumTopicMessagesWithContext is the context-aware variant of UnpinAllGeneralForumTopicMessages.
// Since: Bot API 6.4
// It executes the same request but uses ctx for cancellation and deadlines.
// See https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages
func (api *API) UnpinAllGeneralForumTopicMessagesWithContext(ctx context.Context, params BaseGeneralForumTopic) (bool, error) {