commit
c33a1d7c56
295
configs.go
295
configs.go
|
@ -463,7 +463,7 @@ func (config PhotoConfig) files() []RequestFile {
|
|||
|
||||
if config.Thumb != nil {
|
||||
files = append(files, RequestFile{
|
||||
Name: "thumb",
|
||||
Name: "thumbnail",
|
||||
Data: config.Thumb,
|
||||
})
|
||||
}
|
||||
|
@ -511,7 +511,7 @@ func (config AudioConfig) files() []RequestFile {
|
|||
|
||||
if config.Thumb != nil {
|
||||
files = append(files, RequestFile{
|
||||
Name: "thumb",
|
||||
Name: "thumbnail",
|
||||
Data: config.Thumb,
|
||||
})
|
||||
}
|
||||
|
@ -551,7 +551,7 @@ func (config DocumentConfig) files() []RequestFile {
|
|||
|
||||
if config.Thumb != nil {
|
||||
files = append(files, RequestFile{
|
||||
Name: "thumb",
|
||||
Name: "thumbnail",
|
||||
Data: config.Thumb,
|
||||
})
|
||||
}
|
||||
|
@ -561,11 +561,18 @@ func (config DocumentConfig) files() []RequestFile {
|
|||
|
||||
// StickerConfig contains information about a SendSticker request.
|
||||
type StickerConfig struct {
|
||||
//Emoji associated with the sticker; only for just uploaded stickers
|
||||
Emoji string
|
||||
BaseFile
|
||||
}
|
||||
|
||||
func (config StickerConfig) params() (Params, error) {
|
||||
return config.BaseChat.params()
|
||||
params, err := config.BaseChat.params()
|
||||
if err != nil {
|
||||
return params, err
|
||||
}
|
||||
params.AddNonEmpty("emoji", config.Emoji)
|
||||
return params, err
|
||||
}
|
||||
|
||||
func (config StickerConfig) method() string {
|
||||
|
@ -627,7 +634,7 @@ func (config VideoConfig) files() []RequestFile {
|
|||
|
||||
if config.Thumb != nil {
|
||||
files = append(files, RequestFile{
|
||||
Name: "thumb",
|
||||
Name: "thumbnail",
|
||||
Data: config.Thumb,
|
||||
})
|
||||
}
|
||||
|
@ -681,7 +688,7 @@ func (config AnimationConfig) files() []RequestFile {
|
|||
|
||||
if config.Thumb != nil {
|
||||
files = append(files, RequestFile{
|
||||
Name: "thumb",
|
||||
Name: "thumbnail",
|
||||
Data: config.Thumb,
|
||||
})
|
||||
}
|
||||
|
@ -718,7 +725,7 @@ func (config VideoNoteConfig) files() []RequestFile {
|
|||
|
||||
if config.Thumb != nil {
|
||||
files = append(files, RequestFile{
|
||||
Name: "thumb",
|
||||
Name: "thumbnail",
|
||||
Data: config.Thumb,
|
||||
})
|
||||
}
|
||||
|
@ -762,7 +769,7 @@ func (config VoiceConfig) files() []RequestFile {
|
|||
|
||||
if config.Thumb != nil {
|
||||
files = append(files, RequestFile{
|
||||
Name: "thumb",
|
||||
Name: "thumbnail",
|
||||
Data: config.Thumb,
|
||||
})
|
||||
}
|
||||
|
@ -2139,8 +2146,9 @@ func (config GetCustomEmojiStickersConfig) method() string {
|
|||
|
||||
// UploadStickerConfig allows you to upload a sticker for use in a set later.
|
||||
type UploadStickerConfig struct {
|
||||
UserID int64
|
||||
PNGSticker RequestFileData
|
||||
UserID int64
|
||||
Sticker RequestFile
|
||||
StickerFormat string
|
||||
}
|
||||
|
||||
func (config UploadStickerConfig) method() string {
|
||||
|
@ -2151,30 +2159,24 @@ func (config UploadStickerConfig) params() (Params, error) {
|
|||
params := make(Params)
|
||||
|
||||
params.AddNonZero64("user_id", config.UserID)
|
||||
params["sticker_format"] = config.StickerFormat
|
||||
|
||||
return params, nil
|
||||
}
|
||||
|
||||
func (config UploadStickerConfig) files() []RequestFile {
|
||||
return []RequestFile{{
|
||||
Name: "png_sticker",
|
||||
Data: config.PNGSticker,
|
||||
}}
|
||||
return []RequestFile{config.Sticker}
|
||||
}
|
||||
|
||||
// NewStickerSetConfig allows creating a new sticker set.
|
||||
//
|
||||
// You must set either PNGSticker or TGSSticker.
|
||||
type NewStickerSetConfig struct {
|
||||
UserID int64
|
||||
Name string
|
||||
Title string
|
||||
PNGSticker RequestFileData
|
||||
TGSSticker RequestFileData
|
||||
StickerType string
|
||||
Emojis string
|
||||
ContainsMasks bool // deprecated
|
||||
MaskPosition *MaskPosition
|
||||
UserID int64
|
||||
Name string
|
||||
Title string
|
||||
Stickers []InputSticker
|
||||
StickerFormat string
|
||||
StickerType string
|
||||
NeedsRepainting bool //optional; Pass True if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only
|
||||
}
|
||||
|
||||
func (config NewStickerSetConfig) method() string {
|
||||
|
@ -2187,37 +2189,28 @@ func (config NewStickerSetConfig) params() (Params, error) {
|
|||
params.AddNonZero64("user_id", config.UserID)
|
||||
params["name"] = config.Name
|
||||
params["title"] = config.Title
|
||||
params["emojis"] = config.Emojis
|
||||
params["sticker_format"] = config.StickerFormat
|
||||
|
||||
params.AddBool("contains_masks", config.ContainsMasks)
|
||||
params.AddBool("needs_repainting", config.NeedsRepainting)
|
||||
params.AddNonEmpty("sticker_type", string(config.StickerType))
|
||||
err := params.AddInterface("mask_position", config.MaskPosition)
|
||||
err := params.AddInterface("stickers", config.Stickers)
|
||||
|
||||
return params, err
|
||||
}
|
||||
|
||||
func (config NewStickerSetConfig) files() []RequestFile {
|
||||
if config.PNGSticker != nil {
|
||||
return []RequestFile{{
|
||||
Name: "png_sticker",
|
||||
Data: config.PNGSticker,
|
||||
}}
|
||||
requestFiles := []RequestFile{}
|
||||
for _, v := range config.Stickers {
|
||||
requestFiles = append(requestFiles, v.Sticker)
|
||||
}
|
||||
|
||||
return []RequestFile{{
|
||||
Name: "tgs_sticker",
|
||||
Data: config.TGSSticker,
|
||||
}}
|
||||
return requestFiles
|
||||
}
|
||||
|
||||
// AddStickerConfig allows you to add a sticker to a set.
|
||||
type AddStickerConfig struct {
|
||||
UserID int64
|
||||
Name string
|
||||
PNGSticker RequestFileData
|
||||
TGSSticker RequestFileData
|
||||
Emojis string
|
||||
MaskPosition *MaskPosition
|
||||
UserID int64
|
||||
Name string
|
||||
Sticker InputSticker
|
||||
}
|
||||
|
||||
func (config AddStickerConfig) method() string {
|
||||
|
@ -2229,26 +2222,12 @@ func (config AddStickerConfig) params() (Params, error) {
|
|||
|
||||
params.AddNonZero64("user_id", config.UserID)
|
||||
params["name"] = config.Name
|
||||
params["emojis"] = config.Emojis
|
||||
|
||||
err := params.AddInterface("mask_position", config.MaskPosition)
|
||||
|
||||
err := params.AddInterface("sticker", config.Sticker)
|
||||
return params, err
|
||||
}
|
||||
|
||||
func (config AddStickerConfig) files() []RequestFile {
|
||||
if config.PNGSticker != nil {
|
||||
return []RequestFile{{
|
||||
Name: "png_sticker",
|
||||
Data: config.PNGSticker,
|
||||
}}
|
||||
}
|
||||
|
||||
return []RequestFile{{
|
||||
Name: "tgs_sticker",
|
||||
Data: config.TGSSticker,
|
||||
}}
|
||||
|
||||
return []RequestFile{config.Sticker.Sticker}
|
||||
}
|
||||
|
||||
// SetStickerPositionConfig allows you to change the position of a sticker in a set.
|
||||
|
@ -2270,6 +2249,61 @@ func (config SetStickerPositionConfig) params() (Params, error) {
|
|||
return params, nil
|
||||
}
|
||||
|
||||
// SetCustomEmojiStickerSetThumbnalConfig allows you to set the thumbnail of a custom emoji sticker set
|
||||
type SetCustomEmojiStickerSetThumbnalConfig struct {
|
||||
Name string
|
||||
CustomEmojiID string
|
||||
}
|
||||
|
||||
func (config SetCustomEmojiStickerSetThumbnalConfig) method() string {
|
||||
return "setCustomEmojiStickerSetThumbnail"
|
||||
}
|
||||
|
||||
func (config SetCustomEmojiStickerSetThumbnalConfig) params() (Params, error) {
|
||||
params := make(Params)
|
||||
|
||||
params["name"] = config.Name
|
||||
params.AddNonEmpty("position", config.CustomEmojiID)
|
||||
|
||||
return params, nil
|
||||
}
|
||||
|
||||
// SetStickerSetTitle allows you to set the title of a created sticker set
|
||||
type SetStickerSetTitleConfig struct {
|
||||
Name string
|
||||
Title string
|
||||
}
|
||||
|
||||
func (config SetStickerSetTitleConfig) method() string {
|
||||
return "setStickerSetTitle"
|
||||
}
|
||||
|
||||
func (config SetStickerSetTitleConfig) params() (Params, error) {
|
||||
params := make(Params)
|
||||
|
||||
params["name"] = config.Name
|
||||
params["title"] = config.Title
|
||||
|
||||
return params, nil
|
||||
}
|
||||
|
||||
// DeleteStickerSetConfig allows you to delete a sticker set that was created by the bot.
|
||||
type DeleteStickerSetConfig struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
func (config DeleteStickerSetConfig) method() string {
|
||||
return "deleteStickerSet"
|
||||
}
|
||||
|
||||
func (config DeleteStickerSetConfig) params() (Params, error) {
|
||||
params := make(Params)
|
||||
|
||||
params["name"] = config.Name
|
||||
|
||||
return params, nil
|
||||
}
|
||||
|
||||
// DeleteStickerConfig allows you to delete a sticker from a set.
|
||||
type DeleteStickerConfig struct {
|
||||
Sticker string
|
||||
|
@ -2287,6 +2321,63 @@ func (config DeleteStickerConfig) params() (Params, error) {
|
|||
return params, nil
|
||||
}
|
||||
|
||||
// SetStickerEmojiListConfig allows you to change the list of emoji assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot
|
||||
type SetStickerEmojiListConfig struct {
|
||||
Sticker string
|
||||
EmojiList []string
|
||||
}
|
||||
|
||||
func (config SetStickerEmojiListConfig) method() string {
|
||||
return "setStickerEmojiList"
|
||||
}
|
||||
|
||||
func (config SetStickerEmojiListConfig) params() (Params, error) {
|
||||
params := make(Params)
|
||||
|
||||
params["sticker"] = config.Sticker
|
||||
err := params.AddInterface("emoji_list", config.EmojiList)
|
||||
|
||||
return params, err
|
||||
}
|
||||
|
||||
// SetStickerKeywordsConfig allows you to change search keywords assigned to a regular or custom emoji sticker. The sticker must belong to a sticker set created by the bot.
|
||||
type SetStickerKeywordsConfig struct {
|
||||
Sticker string
|
||||
Keywords []string
|
||||
}
|
||||
|
||||
func (config SetStickerKeywordsConfig) method() string {
|
||||
return "setStickerKeywords"
|
||||
}
|
||||
|
||||
func (config SetStickerKeywordsConfig) params() (Params, error) {
|
||||
params := make(Params)
|
||||
|
||||
params["sticker"] = config.Sticker
|
||||
err := params.AddInterface("keywords", config.Keywords)
|
||||
|
||||
return params, err
|
||||
}
|
||||
|
||||
// SetStickerMaskPositionConfig allows you to change the mask position of a mask sticker. The sticker must belong to a sticker set that was created by the bot
|
||||
type SetStickerMaskPositionConfig struct {
|
||||
Sticker string
|
||||
MaskPosition *MaskPosition
|
||||
}
|
||||
|
||||
func (config SetStickerMaskPositionConfig) method() string {
|
||||
return "setStickerMaskPosition"
|
||||
}
|
||||
|
||||
func (config SetStickerMaskPositionConfig) params() (Params, error) {
|
||||
params := make(Params)
|
||||
|
||||
params["sticker"] = config.Sticker
|
||||
err := params.AddInterface("keywords", config.MaskPosition)
|
||||
|
||||
return params, err
|
||||
}
|
||||
|
||||
// SetStickerSetThumbConfig allows you to set the thumbnail for a sticker set.
|
||||
type SetStickerSetThumbConfig struct {
|
||||
Name string
|
||||
|
@ -2295,7 +2386,7 @@ type SetStickerSetThumbConfig struct {
|
|||
}
|
||||
|
||||
func (config SetStickerSetThumbConfig) method() string {
|
||||
return "setStickerSetThumb"
|
||||
return "setStickerSetThumbnail"
|
||||
}
|
||||
|
||||
func (config SetStickerSetThumbConfig) params() (Params, error) {
|
||||
|
@ -2309,7 +2400,7 @@ func (config SetStickerSetThumbConfig) params() (Params, error) {
|
|||
|
||||
func (config SetStickerSetThumbConfig) files() []RequestFile {
|
||||
return []RequestFile{{
|
||||
Name: "thumb",
|
||||
Name: "thumbnail",
|
||||
Data: config.Thumb,
|
||||
}}
|
||||
}
|
||||
|
@ -2704,6 +2795,86 @@ func (config DeleteMyCommandsConfig) params() (Params, error) {
|
|||
return params, err
|
||||
}
|
||||
|
||||
// GetMyDescriptionConfig get the current bot description for the given user language
|
||||
type GetMyDescriptionConfig struct {
|
||||
LanguageCode string
|
||||
}
|
||||
|
||||
func (config GetMyDescriptionConfig) method() string {
|
||||
return "getMyDescription"
|
||||
}
|
||||
|
||||
func (config GetMyDescriptionConfig) params() (Params, error) {
|
||||
params := make(Params)
|
||||
|
||||
params.AddNonEmpty("language_code", config.LanguageCode)
|
||||
|
||||
return params, nil
|
||||
}
|
||||
|
||||
// SetMyDescroptionConfig sets the bot's description, which is shown in the chat with the bot if the chat is empty
|
||||
type SetMyDescriptionConfig struct {
|
||||
// Pass an empty string to remove the dedicated description for the given language.
|
||||
Description string
|
||||
//If empty, the description will be applied to all users for whose language there is no dedicated description.
|
||||
LanguageCode string
|
||||
}
|
||||
|
||||
func (config SetMyDescriptionConfig) method() string {
|
||||
return "setMyDescription"
|
||||
}
|
||||
|
||||
func (config SetMyDescriptionConfig) params() (Params, error) {
|
||||
params := make(Params)
|
||||
|
||||
params.AddNonEmpty("description", config.Description)
|
||||
params.AddNonEmpty("language_code", config.LanguageCode)
|
||||
|
||||
return params, nil
|
||||
}
|
||||
|
||||
// GetMyShortDescriptionConfig get the current bot short description for the given user language
|
||||
type GetMyShortDescriptionConfig struct {
|
||||
LanguageCode string
|
||||
}
|
||||
|
||||
func (config GetMyShortDescriptionConfig) method() string {
|
||||
return "getMyShortDescription"
|
||||
}
|
||||
|
||||
func (config GetMyShortDescriptionConfig) params() (Params, error) {
|
||||
params := make(Params)
|
||||
|
||||
params.AddNonEmpty("language_code", config.LanguageCode)
|
||||
|
||||
return params, nil
|
||||
}
|
||||
|
||||
// SetMyDescroptionConfig sets the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot.
|
||||
type SetMyShortDescriptionConfig struct {
|
||||
// New short description for the bot; 0-120 characters.
|
||||
//
|
||||
//Pass an empty string to remove the dedicated short description for the given language.
|
||||
ShortDescription string
|
||||
//A two-letter ISO 639-1 language code.
|
||||
//
|
||||
//If empty, the short description will be applied to all users for whose language there is no dedicated short description.
|
||||
LanguageCode string
|
||||
}
|
||||
|
||||
func (config SetMyShortDescriptionConfig) method() string {
|
||||
return "setMyDescription"
|
||||
}
|
||||
|
||||
func (config SetMyShortDescriptionConfig) params() (Params, error) {
|
||||
params := make(Params)
|
||||
|
||||
params.AddNonEmpty("short_description", config.ShortDescription)
|
||||
params.AddNonEmpty("language_code", config.LanguageCode)
|
||||
|
||||
return params, nil
|
||||
}
|
||||
|
||||
// SetChatMenuButtonConfig changes the bot's menu button in a private chat,
|
||||
// or the default menu button.
|
||||
type SetChatMenuButtonConfig struct {
|
||||
|
|
55
helpers.go
55
helpers.go
|
@ -130,6 +130,29 @@ func NewSticker(chatID int64, file RequestFileData) StickerConfig {
|
|||
}
|
||||
}
|
||||
|
||||
// NewCustomEmojiStickerSetThumbnal creates a new setCustomEmojiStickerSetThumbnal request
|
||||
func NewCustomEmojiStickerSetThumbnal(name, customEmojiID string) SetCustomEmojiStickerSetThumbnalConfig {
|
||||
return SetCustomEmojiStickerSetThumbnalConfig{
|
||||
Name: name,
|
||||
CustomEmojiID: customEmojiID,
|
||||
}
|
||||
}
|
||||
|
||||
// NewStickerSetTitle creates a new setStickerSetTitle request
|
||||
func NewStickerSetTitle(name, title string) SetStickerSetTitleConfig {
|
||||
return SetStickerSetTitleConfig{
|
||||
Name: name,
|
||||
Title: title,
|
||||
}
|
||||
}
|
||||
|
||||
// NewDeleteStickerSet creates a new deleteStickerSet request
|
||||
func NewDeleteStickerSet(name, title string) DeleteStickerSetConfig {
|
||||
return DeleteStickerSetConfig{
|
||||
Name: name,
|
||||
}
|
||||
}
|
||||
|
||||
// NewVideo creates a new sendVideo request.
|
||||
func NewVideo(chatID int64, file RequestFileData) VideoConfig {
|
||||
return VideoConfig{
|
||||
|
@ -181,7 +204,7 @@ func NewMediaGroup(chatID int64, files []interface{}) MediaGroupConfig {
|
|||
BaseChat: BaseChat{
|
||||
ChatID: chatID,
|
||||
},
|
||||
Media: files,
|
||||
Media: files,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -908,6 +931,36 @@ func NewBotCommandScopeChatMember(chatID, userID int64) BotCommandScope {
|
|||
}
|
||||
}
|
||||
|
||||
// NewSetMyDescription allows you to change the bot's description, which is shown in the chat with the bot if the chat is empty.
|
||||
func NewSetMyDescription(description, languageCode string) SetMyDescriptionConfig {
|
||||
return SetMyDescriptionConfig{
|
||||
Description: description,
|
||||
LanguageCode: languageCode,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMyDescription returns the current bot description for the given user language
|
||||
func NewGetMyDescription(languageCode string) GetMyDescriptionConfig {
|
||||
return GetMyDescriptionConfig{
|
||||
LanguageCode: languageCode,
|
||||
}
|
||||
}
|
||||
|
||||
// NewSetMyShortDescription allows you change the bot's short description, which is shown on the bot's profile page and is sent together with the link when users share the bot.
|
||||
func NewSetMyShortDescription(shortDescription, languageCode string) SetMyShortDescriptionConfig {
|
||||
return SetMyShortDescriptionConfig{
|
||||
ShortDescription: shortDescription,
|
||||
LanguageCode: languageCode,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMyShortDescription returns the current bot short description for the given user language.
|
||||
func NewGetMyShortDescription(languageCode string) GetMyShortDescriptionConfig {
|
||||
return GetMyShortDescriptionConfig{
|
||||
LanguageCode: languageCode,
|
||||
}
|
||||
}
|
||||
|
||||
// NewGetMyCommandsWithScope allows you to set the registered commands for a
|
||||
// given scope.
|
||||
func NewGetMyCommandsWithScope(scope BotCommandScope) GetMyCommandsConfig {
|
||||
|
|
94
types.go
94
types.go
|
@ -953,7 +953,7 @@ type Animation struct {
|
|||
// Thumbnail animation thumbnail as defined by sender
|
||||
//
|
||||
// optional
|
||||
Thumbnail *PhotoSize `json:"thumb,omitempty"`
|
||||
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||
// FileName original animation filename as defined by sender
|
||||
//
|
||||
// optional
|
||||
|
@ -1002,7 +1002,7 @@ type Audio struct {
|
|||
// Thumbnail is the album cover to which the music file belongs
|
||||
//
|
||||
// optional
|
||||
Thumbnail *PhotoSize `json:"thumb,omitempty"`
|
||||
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||
}
|
||||
|
||||
// Document represents a general file.
|
||||
|
@ -1017,7 +1017,7 @@ type Document struct {
|
|||
// Thumbnail document thumbnail as defined by sender
|
||||
//
|
||||
// optional
|
||||
Thumbnail *PhotoSize `json:"thumb,omitempty"`
|
||||
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||
// FileName original filename as defined by sender
|
||||
//
|
||||
// optional
|
||||
|
@ -1050,7 +1050,7 @@ type Video struct {
|
|||
// Thumbnail video thumbnail
|
||||
//
|
||||
// optional
|
||||
Thumbnail *PhotoSize `json:"thumb,omitempty"`
|
||||
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||
// FileName is the original filename as defined by sender
|
||||
//
|
||||
// optional
|
||||
|
@ -1080,7 +1080,7 @@ type VideoNote struct {
|
|||
// Thumbnail video thumbnail
|
||||
//
|
||||
// optional
|
||||
Thumbnail *PhotoSize `json:"thumb,omitempty"`
|
||||
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||
// FileSize file size
|
||||
//
|
||||
// optional
|
||||
|
@ -2212,6 +2212,16 @@ type BotCommandScope struct {
|
|||
UserID int64 `json:"user_id,omitempty"`
|
||||
}
|
||||
|
||||
// BotDescription represents the bot's description.
|
||||
type BotDescription struct {
|
||||
Description string `json:"description"`
|
||||
}
|
||||
|
||||
// BotShortDescription represents the bot's short description
|
||||
type BotShortDescription struct {
|
||||
ShortDescription string `json:"short_description"`
|
||||
}
|
||||
|
||||
// MenuButton describes the bot's menu button in a private chat.
|
||||
type MenuButton struct {
|
||||
// Type is the type of menu button, must be one of:
|
||||
|
@ -2284,7 +2294,7 @@ type InputMediaVideo struct {
|
|||
// the file is supported server-side.
|
||||
//
|
||||
// optional
|
||||
Thumb RequestFileData `json:"thumb,omitempty"`
|
||||
Thumb RequestFileData `json:"thumbnail,omitempty"`
|
||||
// Width video width
|
||||
//
|
||||
// optional
|
||||
|
@ -2314,7 +2324,7 @@ type InputMediaAnimation struct {
|
|||
// the file is supported server-side.
|
||||
//
|
||||
// optional
|
||||
Thumb RequestFileData `json:"thumb,omitempty"`
|
||||
Thumb RequestFileData `json:"thumbnail,omitempty"`
|
||||
// Width video width
|
||||
//
|
||||
// optional
|
||||
|
@ -2340,7 +2350,7 @@ type InputMediaAudio struct {
|
|||
// the file is supported server-side.
|
||||
//
|
||||
// optional
|
||||
Thumb RequestFileData `json:"thumb,omitempty"`
|
||||
Thumb RequestFileData `json:"thumbnail,omitempty"`
|
||||
// Duration of the audio in seconds
|
||||
//
|
||||
// optional
|
||||
|
@ -2362,7 +2372,7 @@ type InputMediaDocument struct {
|
|||
// the file is supported server-side.
|
||||
//
|
||||
// optional
|
||||
Thumb RequestFileData `json:"thumb,omitempty"`
|
||||
Thumb RequestFileData `json:"thumbnail,omitempty"`
|
||||
// DisableContentTypeDetection disables automatic server-side content type
|
||||
// detection for files uploaded using multipart/form-data. Always true, if
|
||||
// the document is sent as part of an album
|
||||
|
@ -2406,7 +2416,7 @@ type Sticker struct {
|
|||
// Thumbnail sticker thumbnail in the .WEBP or .JPG format
|
||||
//
|
||||
// optional
|
||||
Thumbnail *PhotoSize `json:"thumb,omitempty"`
|
||||
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||
// Emoji associated with the sticker
|
||||
//
|
||||
// optional
|
||||
|
@ -2428,6 +2438,10 @@ type Sticker struct {
|
|||
//
|
||||
// optional
|
||||
CustomEmojiID string `json:"custom_emoji_id,omitempty"`
|
||||
// NeedsRepainting True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places
|
||||
//
|
||||
//optional
|
||||
NeedsRepainting bool `json:"needs_reainting,omitempty"`
|
||||
// FileSize
|
||||
//
|
||||
// optional
|
||||
|
@ -2468,7 +2482,7 @@ type StickerSet struct {
|
|||
// Stickers list of all set stickers
|
||||
Stickers []Sticker `json:"stickers"`
|
||||
// Thumb is the sticker set thumbnail in the .WEBP or .TGS format
|
||||
Thumbnail *PhotoSize `json:"thumb"`
|
||||
Thumbnail *PhotoSize `json:"thumbnail"`
|
||||
}
|
||||
|
||||
// IsRegular returns if the StickerSet is regular
|
||||
|
@ -2504,6 +2518,22 @@ type MaskPosition struct {
|
|||
Scale float64 `json:"scale"`
|
||||
}
|
||||
|
||||
// InputSticker describes a sticker to be added to a sticker set.
|
||||
type InputSticker struct {
|
||||
// The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL.
|
||||
Sticker RequestFile `json:"sticker"`
|
||||
// List of 1-20 emoji associated with the sticker
|
||||
EmojiList []string `json:"emoji_list"`
|
||||
// Position where the mask should be placed on faces. For “mask” stickers only.
|
||||
//
|
||||
// optional
|
||||
MaskPosition *MaskPosition `json:"mask_position"`
|
||||
// List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only.
|
||||
//
|
||||
// optional
|
||||
Keywords []string `json:"keywords"`
|
||||
}
|
||||
|
||||
// Game represents a game. Use BotFather to create and edit games, their short
|
||||
// names will act as unique identifiers.
|
||||
type Game struct {
|
||||
|
@ -2923,15 +2953,15 @@ type InlineQueryResultArticle struct {
|
|||
// ThumbURL url of the thumbnail for the result
|
||||
//
|
||||
// optional
|
||||
ThumbURL string `json:"thumb_url,omitempty"`
|
||||
ThumbURL string `json:"thumbnail_url,omitempty"`
|
||||
// ThumbWidth thumbnail width
|
||||
//
|
||||
// optional
|
||||
ThumbWidth int `json:"thumb_width,omitempty"`
|
||||
ThumbWidth int `json:"thumbnail_width,omitempty"`
|
||||
// ThumbHeight thumbnail height
|
||||
//
|
||||
// optional
|
||||
ThumbHeight int `json:"thumb_height,omitempty"`
|
||||
ThumbHeight int `json:"thumbnail_height,omitempty"`
|
||||
}
|
||||
|
||||
// InlineQueryResultAudio is an inline query response audio.
|
||||
|
@ -2987,9 +3017,9 @@ type InlineQueryResultContact struct {
|
|||
VCard string `json:"vcard"`
|
||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||
InputMessageContent interface{} `json:"input_message_content,omitempty"`
|
||||
ThumbURL string `json:"thumb_url"`
|
||||
ThumbWidth int `json:"thumb_width"`
|
||||
ThumbHeight int `json:"thumb_height"`
|
||||
ThumbURL string `json:"thumbnail_url"`
|
||||
ThumbWidth int `json:"thumbnail_width"`
|
||||
ThumbHeight int `json:"thumbnail_height"`
|
||||
}
|
||||
|
||||
// InlineQueryResultGame is an inline query response game.
|
||||
|
@ -3037,15 +3067,15 @@ type InlineQueryResultDocument struct {
|
|||
// ThumbURL url of the thumbnail (jpeg only) for the file
|
||||
//
|
||||
// optional
|
||||
ThumbURL string `json:"thumb_url,omitempty"`
|
||||
ThumbURL string `json:"thumbnail_url,omitempty"`
|
||||
// ThumbWidth thumbnail width
|
||||
//
|
||||
// optional
|
||||
ThumbWidth int `json:"thumb_width,omitempty"`
|
||||
ThumbWidth int `json:"thumbnail_width,omitempty"`
|
||||
// ThumbHeight thumbnail height
|
||||
//
|
||||
// optional
|
||||
ThumbHeight int `json:"thumb_height,omitempty"`
|
||||
ThumbHeight int `json:"thumbnail_height,omitempty"`
|
||||
}
|
||||
|
||||
// InlineQueryResultGIF is an inline query response GIF.
|
||||
|
@ -3057,7 +3087,9 @@ type InlineQueryResultGIF struct {
|
|||
// URL a valid URL for the GIF file. File size must not exceed 1MB.
|
||||
URL string `json:"gif_url"`
|
||||
// ThumbURL url of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result.
|
||||
ThumbURL string `json:"thumb_url"`
|
||||
ThumbURL string `json:"thumbnail_url"`
|
||||
// MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
|
||||
ThumbMimeType string `json:"thumbnail_mime_type,omitempty"`
|
||||
// Width of the GIF
|
||||
//
|
||||
// optional
|
||||
|
@ -3143,15 +3175,15 @@ type InlineQueryResultLocation struct {
|
|||
// ThumbURL url of the thumbnail for the result
|
||||
//
|
||||
// optional
|
||||
ThumbURL string `json:"thumb_url,omitempty"`
|
||||
ThumbURL string `json:"thumbnail_url,omitempty"`
|
||||
// ThumbWidth thumbnail width
|
||||
//
|
||||
// optional
|
||||
ThumbWidth int `json:"thumb_width,omitempty"`
|
||||
ThumbWidth int `json:"thumbnail_width,omitempty"`
|
||||
// ThumbHeight thumbnail height
|
||||
//
|
||||
// optional
|
||||
ThumbHeight int `json:"thumb_height,omitempty"`
|
||||
ThumbHeight int `json:"thumbnail_height,omitempty"`
|
||||
}
|
||||
|
||||
// InlineQueryResultMPEG4GIF is an inline query response MPEG4 GIF.
|
||||
|
@ -3175,7 +3207,9 @@ type InlineQueryResultMPEG4GIF struct {
|
|||
// optional
|
||||
Duration int `json:"mpeg4_duration,omitempty"`
|
||||
// ThumbURL url of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result.
|
||||
ThumbURL string `json:"thumb_url"`
|
||||
ThumbURL string `json:"thumbnail_url"`
|
||||
// MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
|
||||
ThumbMimeType string `json:"thumbnail_mime_type,omitempty"`
|
||||
// Title for the result
|
||||
//
|
||||
// optional
|
||||
|
@ -3227,7 +3261,7 @@ type InlineQueryResultPhoto struct {
|
|||
// ThumbURL url of the thumbnail for the photo.
|
||||
//
|
||||
// optional
|
||||
ThumbURL string `json:"thumb_url,omitempty"`
|
||||
ThumbURL string `json:"thumbnail_url,omitempty"`
|
||||
// Title for the result
|
||||
//
|
||||
// optional
|
||||
|
@ -3303,15 +3337,15 @@ type InlineQueryResultVenue struct {
|
|||
// ThumbURL url of the thumbnail for the result
|
||||
//
|
||||
// optional
|
||||
ThumbURL string `json:"thumb_url,omitempty"`
|
||||
ThumbURL string `json:"thumbnail_url,omitempty"`
|
||||
// ThumbWidth thumbnail width
|
||||
//
|
||||
// optional
|
||||
ThumbWidth int `json:"thumb_width,omitempty"`
|
||||
ThumbWidth int `json:"thumbnail_width,omitempty"`
|
||||
// ThumbHeight thumbnail height
|
||||
//
|
||||
// optional
|
||||
ThumbHeight int `json:"thumb_height,omitempty"`
|
||||
ThumbHeight int `json:"thumbnail_height,omitempty"`
|
||||
}
|
||||
|
||||
// InlineQueryResultVideo is an inline query response video.
|
||||
|
@ -3327,7 +3361,7 @@ type InlineQueryResultVideo struct {
|
|||
//
|
||||
// ThumbURL url of the thumbnail (jpeg only) for the video
|
||||
// optional
|
||||
ThumbURL string `json:"thumb_url,omitempty"`
|
||||
ThumbURL string `json:"thumbnail_url,omitempty"`
|
||||
// Title for the result
|
||||
Title string `json:"title"`
|
||||
// Caption of the video to be sent, 0-1024 characters after entities parsing
|
||||
|
|
|
@ -359,6 +359,16 @@ var (
|
|||
_ Chattable = ReopenGeneralForumTopicConfig{}
|
||||
_ Chattable = HideGeneralForumTopicConfig{}
|
||||
_ Chattable = UnhideGeneralForumTopicConfig{}
|
||||
_ Chattable = SetCustomEmojiStickerSetThumbnalConfig{}
|
||||
_ Chattable = SetStickerSetTitleConfig{}
|
||||
_ Chattable = DeleteStickerSetConfig{}
|
||||
_ Chattable = SetStickerEmojiListConfig{}
|
||||
_ Chattable = SetStickerKeywordsConfig{}
|
||||
_ Chattable = SetStickerMaskPositionConfig{}
|
||||
_ Chattable = GetMyDescriptionConfig{}
|
||||
_ Chattable = SetMyDescriptionConfig{}
|
||||
_ Chattable = GetMyShortDescriptionConfig{}
|
||||
_ Chattable = SetMyShortDescriptionConfig{}
|
||||
)
|
||||
|
||||
// Ensure all Fileable types are correct.
|
||||
|
|
Loading…
Reference in New Issue