Rename tgapi request structs
Add MaybeInaccessibleMessage tests and godoc Update wiki and Bot API docs for the new naming
This commit is contained in:
+64
-64
@@ -2,9 +2,9 @@ package tgapi
|
||||
|
||||
import "context"
|
||||
|
||||
// SendStickerP holds parameters for the sendSticker method.
|
||||
// SendSticker holds parameters for the sendSticker method.
|
||||
// See https://core.telegram.org/bots/api#sendsticker
|
||||
type SendStickerP struct {
|
||||
type SendSticker struct {
|
||||
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
||||
ChatID int64 `json:"chat_id"`
|
||||
MessageThreadID int `json:"message_thread_id,omitempty"`
|
||||
@@ -24,7 +24,7 @@ type SendStickerP struct {
|
||||
|
||||
// SendSticker sends a static .WEBP, animated .TGS, or video .WEBM sticker.
|
||||
// See https://core.telegram.org/bots/api#sendsticker
|
||||
func (api *API) SendSticker(params SendStickerP) (Message, error) {
|
||||
func (api *API) SendSticker(params SendSticker) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendSticker", params, params.ChatID)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -32,20 +32,20 @@ func (api *API) SendSticker(params SendStickerP) (Message, error) {
|
||||
// SendStickerWithContext is the context-aware variant of SendSticker.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#sendsticker
|
||||
func (api *API) SendStickerWithContext(ctx context.Context, params SendStickerP) (Message, error) {
|
||||
func (api *API) SendStickerWithContext(ctx context.Context, params SendSticker) (Message, error) {
|
||||
req := NewRequestWithChatID[Message]("sendSticker", params, params.ChatID)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
// GetStickerSetP holds parameters for the getStickerSet method.
|
||||
// GetStickerSet holds parameters for the getStickerSet method.
|
||||
// See https://core.telegram.org/bots/api#getstickerset
|
||||
type GetStickerSetP struct {
|
||||
type GetStickerSet struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// GetStickerSet returns a sticker set by its name.
|
||||
// See https://core.telegram.org/bots/api#getstickerset
|
||||
func (api *API) GetStickerSet(params GetStickerSetP) (StickerSet, error) {
|
||||
func (api *API) GetStickerSet(params GetStickerSet) (StickerSet, error) {
|
||||
req := NewRequest[StickerSet]("getStickerSet", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -53,20 +53,20 @@ func (api *API) GetStickerSet(params GetStickerSetP) (StickerSet, error) {
|
||||
// GetStickerSetWithContext is the context-aware variant of GetStickerSet.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#getstickerset
|
||||
func (api *API) GetStickerSetWithContext(ctx context.Context, params GetStickerSetP) (StickerSet, error) {
|
||||
func (api *API) GetStickerSetWithContext(ctx context.Context, params GetStickerSet) (StickerSet, error) {
|
||||
req := NewRequest[StickerSet]("getStickerSet", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
// GetCustomEmojiStickersP holds parameters for the getCustomEmojiStickers method.
|
||||
// GetCustomEmojiStickers holds parameters for the getCustomEmojiStickers method.
|
||||
// See https://core.telegram.org/bots/api#getcustomemojistickers
|
||||
type GetCustomEmojiStickersP struct {
|
||||
type GetCustomEmojiStickers struct {
|
||||
CustomEmojiIDs []string `json:"custom_emoji_ids"`
|
||||
}
|
||||
|
||||
// GetCustomEmojiStickers returns information about custom emoji stickers by their IDs.
|
||||
// See https://core.telegram.org/bots/api#getcustomemojistickers
|
||||
func (api *API) GetCustomEmojiStickers(params GetCustomEmojiStickersP) ([]Sticker, error) {
|
||||
func (api *API) GetCustomEmojiStickers(params GetCustomEmojiStickers) ([]Sticker, error) {
|
||||
req := NewRequest[[]Sticker]("getCustomEmojiStickers", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -74,14 +74,14 @@ func (api *API) GetCustomEmojiStickers(params GetCustomEmojiStickersP) ([]Sticke
|
||||
// GetCustomEmojiStickersWithContext is the context-aware variant of GetCustomEmojiStickers.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#getcustomemojistickers
|
||||
func (api *API) GetCustomEmojiStickersWithContext(ctx context.Context, params GetCustomEmojiStickersP) ([]Sticker, error) {
|
||||
func (api *API) GetCustomEmojiStickersWithContext(ctx context.Context, params GetCustomEmojiStickers) ([]Sticker, error) {
|
||||
req := NewRequest[[]Sticker]("getCustomEmojiStickers", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
// UploadStickerFileP holds parameters for the uploadStickerFile method.
|
||||
// UploadStickerFile holds parameters for the uploadStickerFile method.
|
||||
// See https://core.telegram.org/bots/api#uploadstickerfile
|
||||
type UploadStickerFileP struct {
|
||||
type UploadStickerFile struct {
|
||||
UserID int64 `json:"user_id"`
|
||||
StickerFormat InputStickerFormat `json:"sticker_format"`
|
||||
}
|
||||
@@ -89,7 +89,7 @@ type UploadStickerFileP struct {
|
||||
// UploadStickerFile uploads a sticker file for later use in sticker set methods.
|
||||
// sticker is the file to upload.
|
||||
// See https://core.telegram.org/bots/api#uploadstickerfile
|
||||
func (api *API) UploadStickerFile(params UploadStickerFileP, sticker UploaderFile) (File, error) {
|
||||
func (api *API) UploadStickerFile(params UploadStickerFile, sticker UploaderFile) (File, error) {
|
||||
uploader := NewUploader(api)
|
||||
defer func() {
|
||||
_ = uploader.Close()
|
||||
@@ -101,7 +101,7 @@ func (api *API) UploadStickerFile(params UploadStickerFileP, sticker UploaderFil
|
||||
// UploadStickerFileWithContext is the context-aware variant of UploadStickerFile.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#uploadstickerfile
|
||||
func (api *API) UploadStickerFileWithContext(ctx context.Context, params UploadStickerFileP, sticker UploaderFile) (File, error) {
|
||||
func (api *API) UploadStickerFileWithContext(ctx context.Context, params UploadStickerFile, sticker UploaderFile) (File, error) {
|
||||
uploader := NewUploader(api)
|
||||
defer func() {
|
||||
_ = uploader.Close()
|
||||
@@ -110,9 +110,9 @@ func (api *API) UploadStickerFileWithContext(ctx context.Context, params UploadS
|
||||
return req.DoWithContext(ctx, uploader)
|
||||
}
|
||||
|
||||
// CreateNewStickerSetP holds parameters for the createNewStickerSet method.
|
||||
// CreateNewStickerSet holds parameters for the createNewStickerSet method.
|
||||
// See https://core.telegram.org/bots/api#createnewstickerset
|
||||
type CreateNewStickerSetP struct {
|
||||
type CreateNewStickerSet struct {
|
||||
UserID int64 `json:"user_id"`
|
||||
Name string `json:"name"`
|
||||
Title string `json:"title"`
|
||||
@@ -125,7 +125,7 @@ type CreateNewStickerSetP struct {
|
||||
// CreateNewStickerSet creates a new sticker set owned by a user.
|
||||
// Returns True on success.
|
||||
// See https://core.telegram.org/bots/api#createnewstickerset
|
||||
func (api *API) CreateNewStickerSet(params CreateNewStickerSetP) (bool, error) {
|
||||
func (api *API) CreateNewStickerSet(params CreateNewStickerSet) (bool, error) {
|
||||
req := NewRequest[bool]("createNewStickerSet", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -133,14 +133,14 @@ func (api *API) CreateNewStickerSet(params CreateNewStickerSetP) (bool, error) {
|
||||
// CreateNewStickerSetWithContext is the context-aware variant of CreateNewStickerSet.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#createnewstickerset
|
||||
func (api *API) CreateNewStickerSetWithContext(ctx context.Context, params CreateNewStickerSetP) (bool, error) {
|
||||
func (api *API) CreateNewStickerSetWithContext(ctx context.Context, params CreateNewStickerSet) (bool, error) {
|
||||
req := NewRequest[bool]("createNewStickerSet", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
// AddStickerToSetP holds parameters for the addStickerToSet method.
|
||||
// AddStickerToSet holds parameters for the addStickerToSet method.
|
||||
// See https://core.telegram.org/bots/api#addstickertoset
|
||||
type AddStickerToSetP struct {
|
||||
type AddStickerToSet struct {
|
||||
UserID int64 `json:"user_id"`
|
||||
Name string `json:"name"`
|
||||
Sticker InputSticker `json:"sticker"`
|
||||
@@ -149,7 +149,7 @@ type AddStickerToSetP struct {
|
||||
// AddStickerToSet adds a new sticker to a set created by the bot.
|
||||
// Returns True on success.
|
||||
// See https://core.telegram.org/bots/api#addstickertoset
|
||||
func (api *API) AddStickerToSet(params AddStickerToSetP) (bool, error) {
|
||||
func (api *API) AddStickerToSet(params AddStickerToSet) (bool, error) {
|
||||
req := NewRequest[bool]("addStickerToSet", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -157,14 +157,14 @@ func (api *API) AddStickerToSet(params AddStickerToSetP) (bool, error) {
|
||||
// AddStickerToSetWithContext is the context-aware variant of AddStickerToSet.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#addstickertoset
|
||||
func (api *API) AddStickerToSetWithContext(ctx context.Context, params AddStickerToSetP) (bool, error) {
|
||||
func (api *API) AddStickerToSetWithContext(ctx context.Context, params AddStickerToSet) (bool, error) {
|
||||
req := NewRequest[bool]("addStickerToSet", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
// SetStickerPositionInSetP holds parameters for the setStickerPositionInSet method.
|
||||
// SetStickerPositionInSet holds parameters for the setStickerPositionInSet method.
|
||||
// See https://core.telegram.org/bots/api#setstickerpositioninset
|
||||
type SetStickerPositionInSetP struct {
|
||||
type SetStickerPositionInSet struct {
|
||||
Sticker string `json:"sticker"`
|
||||
Position int `json:"position"`
|
||||
}
|
||||
@@ -172,7 +172,7 @@ type SetStickerPositionInSetP struct {
|
||||
// SetStickerPositionInSet moves a sticker in a set to a specific position.
|
||||
// Returns True on success.
|
||||
// See https://core.telegram.org/bots/api#setstickerpositioninset
|
||||
func (api *API) SetStickerPositionInSet(params SetStickerPositionInSetP) (bool, error) {
|
||||
func (api *API) SetStickerPositionInSet(params SetStickerPositionInSet) (bool, error) {
|
||||
req := NewRequest[bool]("setStickerPositionInSet", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -180,21 +180,21 @@ func (api *API) SetStickerPositionInSet(params SetStickerPositionInSetP) (bool,
|
||||
// SetStickerPositionInSetWithContext is the context-aware variant of SetStickerPositionInSet.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#setstickerpositioninset
|
||||
func (api *API) SetStickerPositionInSetWithContext(ctx context.Context, params SetStickerPositionInSetP) (bool, error) {
|
||||
func (api *API) SetStickerPositionInSetWithContext(ctx context.Context, params SetStickerPositionInSet) (bool, error) {
|
||||
req := NewRequest[bool]("setStickerPositionInSet", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
// DeleteStickerFromSetP holds parameters for the deleteStickerFromSet method.
|
||||
// DeleteStickerFromSet holds parameters for the deleteStickerFromSet method.
|
||||
// See https://core.telegram.org/bots/api#deletestickerfromset
|
||||
type DeleteStickerFromSetP struct {
|
||||
type DeleteStickerFromSet struct {
|
||||
Sticker string `json:"sticker"`
|
||||
}
|
||||
|
||||
// DeleteStickerFromSet deletes a sticker from a set created by the bot.
|
||||
// Returns True on success.
|
||||
// See https://core.telegram.org/bots/api#deletestickerfromset
|
||||
func (api *API) DeleteStickerFromSet(params DeleteStickerFromSetP) (bool, error) {
|
||||
func (api *API) DeleteStickerFromSet(params DeleteStickerFromSet) (bool, error) {
|
||||
req := NewRequest[bool]("deleteStickerFromSet", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -202,14 +202,14 @@ func (api *API) DeleteStickerFromSet(params DeleteStickerFromSetP) (bool, error)
|
||||
// DeleteStickerFromSetWithContext is the context-aware variant of DeleteStickerFromSet.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#deletestickerfromset
|
||||
func (api *API) DeleteStickerFromSetWithContext(ctx context.Context, params DeleteStickerFromSetP) (bool, error) {
|
||||
func (api *API) DeleteStickerFromSetWithContext(ctx context.Context, params DeleteStickerFromSet) (bool, error) {
|
||||
req := NewRequest[bool]("deleteStickerFromSet", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
// ReplaceStickerInSetP holds parameters for the replaceStickerInSet method.
|
||||
// ReplaceStickerInSet holds parameters for the replaceStickerInSet method.
|
||||
// See https://core.telegram.org/bots/api#replacestickerinset
|
||||
type ReplaceStickerInSetP struct {
|
||||
type ReplaceStickerInSet struct {
|
||||
UserID int64 `json:"user_id"`
|
||||
Name string `json:"name"`
|
||||
OldSticker string `json:"old_sticker"`
|
||||
@@ -219,7 +219,7 @@ type ReplaceStickerInSetP struct {
|
||||
// ReplaceStickerInSet replaces an existing sticker in a set with a new one.
|
||||
// Returns True on success.
|
||||
// See https://core.telegram.org/bots/api#replacestickerinset
|
||||
func (api *API) ReplaceStickerInSet(params ReplaceStickerInSetP) (bool, error) {
|
||||
func (api *API) ReplaceStickerInSet(params ReplaceStickerInSet) (bool, error) {
|
||||
req := NewRequest[bool]("replaceStickerInSet", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -227,14 +227,14 @@ func (api *API) ReplaceStickerInSet(params ReplaceStickerInSetP) (bool, error) {
|
||||
// ReplaceStickerInSetWithContext is the context-aware variant of ReplaceStickerInSet.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#replacestickerinset
|
||||
func (api *API) ReplaceStickerInSetWithContext(ctx context.Context, params ReplaceStickerInSetP) (bool, error) {
|
||||
func (api *API) ReplaceStickerInSetWithContext(ctx context.Context, params ReplaceStickerInSet) (bool, error) {
|
||||
req := NewRequest[bool]("replaceStickerInSet", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
// SetStickerEmojiListP holds parameters for the setStickerEmojiList method.
|
||||
// SetStickerEmojiList holds parameters for the setStickerEmojiList method.
|
||||
// See https://core.telegram.org/bots/api#setstickeremojilist
|
||||
type SetStickerEmojiListP struct {
|
||||
type SetStickerEmojiList struct {
|
||||
Sticker string `json:"sticker"`
|
||||
EmojiList []string `json:"emoji_list"`
|
||||
}
|
||||
@@ -242,7 +242,7 @@ type SetStickerEmojiListP struct {
|
||||
// SetStickerEmojiList changes the list of emoji associated with a sticker.
|
||||
// Returns True on success.
|
||||
// See https://core.telegram.org/bots/api#setstickeremojilist
|
||||
func (api *API) SetStickerEmojiList(params SetStickerEmojiListP) (bool, error) {
|
||||
func (api *API) SetStickerEmojiList(params SetStickerEmojiList) (bool, error) {
|
||||
req := NewRequest[bool]("setStickerEmojiList", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -250,14 +250,14 @@ func (api *API) SetStickerEmojiList(params SetStickerEmojiListP) (bool, error) {
|
||||
// SetStickerEmojiListWithContext is the context-aware variant of SetStickerEmojiList.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#setstickeremojilist
|
||||
func (api *API) SetStickerEmojiListWithContext(ctx context.Context, params SetStickerEmojiListP) (bool, error) {
|
||||
func (api *API) SetStickerEmojiListWithContext(ctx context.Context, params SetStickerEmojiList) (bool, error) {
|
||||
req := NewRequest[bool]("setStickerEmojiList", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
// SetStickerKeywordsP holds parameters for the setStickerKeywords method.
|
||||
// SetStickerKeywords holds parameters for the setStickerKeywords method.
|
||||
// See https://core.telegram.org/bots/api#setstickerkeywords
|
||||
type SetStickerKeywordsP struct {
|
||||
type SetStickerKeywords struct {
|
||||
Sticker string `json:"sticker"`
|
||||
Keywords []string `json:"keywords"`
|
||||
}
|
||||
@@ -265,7 +265,7 @@ type SetStickerKeywordsP struct {
|
||||
// SetStickerKeywords changes the keywords of a sticker.
|
||||
// Returns True on success.
|
||||
// See https://core.telegram.org/bots/api#setstickerkeywords
|
||||
func (api *API) SetStickerKeywords(params SetStickerKeywordsP) (bool, error) {
|
||||
func (api *API) SetStickerKeywords(params SetStickerKeywords) (bool, error) {
|
||||
req := NewRequest[bool]("setStickerKeywords", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -273,14 +273,14 @@ func (api *API) SetStickerKeywords(params SetStickerKeywordsP) (bool, error) {
|
||||
// SetStickerKeywordsWithContext is the context-aware variant of SetStickerKeywords.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#setstickerkeywords
|
||||
func (api *API) SetStickerKeywordsWithContext(ctx context.Context, params SetStickerKeywordsP) (bool, error) {
|
||||
func (api *API) SetStickerKeywordsWithContext(ctx context.Context, params SetStickerKeywords) (bool, error) {
|
||||
req := NewRequest[bool]("setStickerKeywords", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
// SetStickerMaskPositionP holds parameters for the setStickerMaskPosition method.
|
||||
// SetStickerMaskPosition holds parameters for the setStickerMaskPosition method.
|
||||
// See https://core.telegram.org/bots/api#setstickermaskposition
|
||||
type SetStickerMaskPositionP struct {
|
||||
type SetStickerMaskPosition struct {
|
||||
Sticker string `json:"sticker"`
|
||||
MaskPosition *MaskPosition `json:"mask_position,omitempty"`
|
||||
}
|
||||
@@ -288,7 +288,7 @@ type SetStickerMaskPositionP struct {
|
||||
// SetStickerMaskPosition changes the mask position of a mask sticker.
|
||||
// Returns True on success.
|
||||
// See https://core.telegram.org/bots/api#setstickermaskposition
|
||||
func (api *API) SetStickerMaskPosition(params SetStickerMaskPositionP) (bool, error) {
|
||||
func (api *API) SetStickerMaskPosition(params SetStickerMaskPosition) (bool, error) {
|
||||
req := NewRequest[bool]("setStickerMaskPosition", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -296,14 +296,14 @@ func (api *API) SetStickerMaskPosition(params SetStickerMaskPositionP) (bool, er
|
||||
// SetStickerMaskPositionWithContext is the context-aware variant of SetStickerMaskPosition.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#setstickermaskposition
|
||||
func (api *API) SetStickerMaskPositionWithContext(ctx context.Context, params SetStickerMaskPositionP) (bool, error) {
|
||||
func (api *API) SetStickerMaskPositionWithContext(ctx context.Context, params SetStickerMaskPosition) (bool, error) {
|
||||
req := NewRequest[bool]("setStickerMaskPosition", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
// SetStickerSetTitleP holds parameters for the setStickerSetTitle method.
|
||||
// SetStickerSetTitle holds parameters for the setStickerSetTitle method.
|
||||
// See https://core.telegram.org/bots/api#setstickersettitle
|
||||
type SetStickerSetTitleP struct {
|
||||
type SetStickerSetTitle struct {
|
||||
Name string `json:"name"`
|
||||
Title string `json:"title"`
|
||||
}
|
||||
@@ -311,7 +311,7 @@ type SetStickerSetTitleP struct {
|
||||
// SetStickerSetTitle sets the title of a sticker set created by the bot.
|
||||
// Returns True on success.
|
||||
// See https://core.telegram.org/bots/api#setstickersettitle
|
||||
func (api *API) SetStickerSetTitle(params SetStickerSetTitleP) (bool, error) {
|
||||
func (api *API) SetStickerSetTitle(params SetStickerSetTitle) (bool, error) {
|
||||
req := NewRequest[bool]("setStickerSetTitle", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -319,14 +319,14 @@ func (api *API) SetStickerSetTitle(params SetStickerSetTitleP) (bool, error) {
|
||||
// SetStickerSetTitleWithContext is the context-aware variant of SetStickerSetTitle.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#setstickersettitle
|
||||
func (api *API) SetStickerSetTitleWithContext(ctx context.Context, params SetStickerSetTitleP) (bool, error) {
|
||||
func (api *API) SetStickerSetTitleWithContext(ctx context.Context, params SetStickerSetTitle) (bool, error) {
|
||||
req := NewRequest[bool]("setStickerSetTitle", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
// SetStickerSetThumbnailP holds parameters for the setStickerSetThumbnail method.
|
||||
// SetStickerSetThumbnail holds parameters for the setStickerSetThumbnail method.
|
||||
// See https://core.telegram.org/bots/api#setstickersetthumbnail
|
||||
type SetStickerSetThumbnailP struct {
|
||||
type SetStickerSetThumbnail struct {
|
||||
Name string `json:"name"`
|
||||
UserID int64 `json:"user_id"`
|
||||
Thumbnail string `json:"thumbnail"`
|
||||
@@ -336,7 +336,7 @@ type SetStickerSetThumbnailP struct {
|
||||
// SetStickerSetThumbnail sets the thumbnail of a sticker set.
|
||||
// Returns True on success.
|
||||
// See https://core.telegram.org/bots/api#setstickersetthumbnail
|
||||
func (api *API) SetStickerSetThumbnail(params SetStickerSetThumbnailP) (bool, error) {
|
||||
func (api *API) SetStickerSetThumbnail(params SetStickerSetThumbnail) (bool, error) {
|
||||
req := NewRequest[bool]("setStickerSetThumbnail", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -344,14 +344,14 @@ func (api *API) SetStickerSetThumbnail(params SetStickerSetThumbnailP) (bool, er
|
||||
// SetStickerSetThumbnailWithContext is the context-aware variant of SetStickerSetThumbnail.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#setstickersetthumbnail
|
||||
func (api *API) SetStickerSetThumbnailWithContext(ctx context.Context, params SetStickerSetThumbnailP) (bool, error) {
|
||||
func (api *API) SetStickerSetThumbnailWithContext(ctx context.Context, params SetStickerSetThumbnail) (bool, error) {
|
||||
req := NewRequest[bool]("setStickerSetThumbnail", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
// SetCustomEmojiStickerSetThumbnailP holds parameters for the setCustomEmojiStickerSetThumbnail method.
|
||||
// SetCustomEmojiStickerSetThumbnail holds parameters for the setCustomEmojiStickerSetThumbnail method.
|
||||
// See https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
|
||||
type SetCustomEmojiStickerSetThumbnailP struct {
|
||||
type SetCustomEmojiStickerSetThumbnail struct {
|
||||
Name string `json:"name"`
|
||||
CustomEmojiID string `json:"custom_emoji_id,omitempty"`
|
||||
}
|
||||
@@ -359,7 +359,7 @@ type SetCustomEmojiStickerSetThumbnailP struct {
|
||||
// SetCustomEmojiStickerSetThumbnail sets the thumbnail of a custom emoji sticker set.
|
||||
// Returns True on success.
|
||||
// See https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
|
||||
func (api *API) SetCustomEmojiStickerSetThumbnail(params SetCustomEmojiStickerSetThumbnailP) (bool, error) {
|
||||
func (api *API) SetCustomEmojiStickerSetThumbnail(params SetCustomEmojiStickerSetThumbnail) (bool, error) {
|
||||
req := NewRequest[bool]("setCustomEmojiStickerSetThumbnail", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -367,21 +367,21 @@ func (api *API) SetCustomEmojiStickerSetThumbnail(params SetCustomEmojiStickerSe
|
||||
// SetCustomEmojiStickerSetThumbnailWithContext is the context-aware variant of SetCustomEmojiStickerSetThumbnail.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail
|
||||
func (api *API) SetCustomEmojiStickerSetThumbnailWithContext(ctx context.Context, params SetCustomEmojiStickerSetThumbnailP) (bool, error) {
|
||||
func (api *API) SetCustomEmojiStickerSetThumbnailWithContext(ctx context.Context, params SetCustomEmojiStickerSetThumbnail) (bool, error) {
|
||||
req := NewRequest[bool]("setCustomEmojiStickerSetThumbnail", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
// DeleteStickerSetP holds parameters for the deleteStickerSet method.
|
||||
// DeleteStickerSet holds parameters for the deleteStickerSet method.
|
||||
// See https://core.telegram.org/bots/api#deletestickerset
|
||||
type DeleteStickerSetP struct {
|
||||
type DeleteStickerSet struct {
|
||||
Name string `json:"name"`
|
||||
}
|
||||
|
||||
// DeleteStickerSet deletes a sticker set created by the bot.
|
||||
// Returns True on success.
|
||||
// See https://core.telegram.org/bots/api#deletestickerset
|
||||
func (api *API) DeleteStickerSet(params DeleteStickerSetP) (bool, error) {
|
||||
func (api *API) DeleteStickerSet(params DeleteStickerSet) (bool, error) {
|
||||
req := NewRequest[bool]("deleteStickerSet", params)
|
||||
return req.Do(api)
|
||||
}
|
||||
@@ -389,7 +389,7 @@ func (api *API) DeleteStickerSet(params DeleteStickerSetP) (bool, error) {
|
||||
// DeleteStickerSetWithContext is the context-aware variant of DeleteStickerSet.
|
||||
// It executes the same request but uses ctx for cancellation and deadlines.
|
||||
// See https://core.telegram.org/bots/api#deletestickerset
|
||||
func (api *API) DeleteStickerSetWithContext(ctx context.Context, params DeleteStickerSetP) (bool, error) {
|
||||
func (api *API) DeleteStickerSetWithContext(ctx context.Context, params DeleteStickerSet) (bool, error) {
|
||||
req := NewRequest[bool]("deleteStickerSet", params)
|
||||
return req.DoWithContext(ctx, api)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user