BOT API 6.6 implementation
parent
3ba8237c47
commit
ef8307cc42
245
configs.go
245
configs.go
|
@ -463,7 +463,7 @@ func (config PhotoConfig) files() []RequestFile {
|
||||||
|
|
||||||
if config.Thumb != nil {
|
if config.Thumb != nil {
|
||||||
files = append(files, RequestFile{
|
files = append(files, RequestFile{
|
||||||
Name: "thumb",
|
Name: "thumbnail",
|
||||||
Data: config.Thumb,
|
Data: config.Thumb,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -511,7 +511,7 @@ func (config AudioConfig) files() []RequestFile {
|
||||||
|
|
||||||
if config.Thumb != nil {
|
if config.Thumb != nil {
|
||||||
files = append(files, RequestFile{
|
files = append(files, RequestFile{
|
||||||
Name: "thumb",
|
Name: "thumbnail",
|
||||||
Data: config.Thumb,
|
Data: config.Thumb,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -551,7 +551,7 @@ func (config DocumentConfig) files() []RequestFile {
|
||||||
|
|
||||||
if config.Thumb != nil {
|
if config.Thumb != nil {
|
||||||
files = append(files, RequestFile{
|
files = append(files, RequestFile{
|
||||||
Name: "thumb",
|
Name: "thumbnail",
|
||||||
Data: config.Thumb,
|
Data: config.Thumb,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -561,11 +561,18 @@ func (config DocumentConfig) files() []RequestFile {
|
||||||
|
|
||||||
// StickerConfig contains information about a SendSticker request.
|
// StickerConfig contains information about a SendSticker request.
|
||||||
type StickerConfig struct {
|
type StickerConfig struct {
|
||||||
|
//Emoji associated with the sticker; only for just uploaded stickers
|
||||||
|
Emoji string
|
||||||
BaseFile
|
BaseFile
|
||||||
}
|
}
|
||||||
|
|
||||||
func (config StickerConfig) params() (Params, error) {
|
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 {
|
func (config StickerConfig) method() string {
|
||||||
|
@ -627,7 +634,7 @@ func (config VideoConfig) files() []RequestFile {
|
||||||
|
|
||||||
if config.Thumb != nil {
|
if config.Thumb != nil {
|
||||||
files = append(files, RequestFile{
|
files = append(files, RequestFile{
|
||||||
Name: "thumb",
|
Name: "thumbnail",
|
||||||
Data: config.Thumb,
|
Data: config.Thumb,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -681,7 +688,7 @@ func (config AnimationConfig) files() []RequestFile {
|
||||||
|
|
||||||
if config.Thumb != nil {
|
if config.Thumb != nil {
|
||||||
files = append(files, RequestFile{
|
files = append(files, RequestFile{
|
||||||
Name: "thumb",
|
Name: "thumbnail",
|
||||||
Data: config.Thumb,
|
Data: config.Thumb,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -718,7 +725,7 @@ func (config VideoNoteConfig) files() []RequestFile {
|
||||||
|
|
||||||
if config.Thumb != nil {
|
if config.Thumb != nil {
|
||||||
files = append(files, RequestFile{
|
files = append(files, RequestFile{
|
||||||
Name: "thumb",
|
Name: "thumbnail",
|
||||||
Data: config.Thumb,
|
Data: config.Thumb,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -762,7 +769,7 @@ func (config VoiceConfig) files() []RequestFile {
|
||||||
|
|
||||||
if config.Thumb != nil {
|
if config.Thumb != nil {
|
||||||
files = append(files, RequestFile{
|
files = append(files, RequestFile{
|
||||||
Name: "thumb",
|
Name: "thumbnail",
|
||||||
Data: config.Thumb,
|
Data: config.Thumb,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -2140,7 +2147,8 @@ func (config GetCustomEmojiStickersConfig) method() string {
|
||||||
// UploadStickerConfig allows you to upload a sticker for use in a set later.
|
// UploadStickerConfig allows you to upload a sticker for use in a set later.
|
||||||
type UploadStickerConfig struct {
|
type UploadStickerConfig struct {
|
||||||
UserID int64
|
UserID int64
|
||||||
PNGSticker RequestFileData
|
Sticker RequestFile
|
||||||
|
StickerFormat string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (config UploadStickerConfig) method() string {
|
func (config UploadStickerConfig) method() string {
|
||||||
|
@ -2151,6 +2159,7 @@ func (config UploadStickerConfig) params() (Params, error) {
|
||||||
params := make(Params)
|
params := make(Params)
|
||||||
|
|
||||||
params.AddNonZero64("user_id", config.UserID)
|
params.AddNonZero64("user_id", config.UserID)
|
||||||
|
params["sticker_format"] = config.StickerFormat
|
||||||
|
|
||||||
return params, nil
|
return params, nil
|
||||||
}
|
}
|
||||||
|
@ -2169,12 +2178,9 @@ type NewStickerSetConfig struct {
|
||||||
UserID int64
|
UserID int64
|
||||||
Name string
|
Name string
|
||||||
Title string
|
Title string
|
||||||
PNGSticker RequestFileData
|
Stickers []InputSticker
|
||||||
TGSSticker RequestFileData
|
|
||||||
StickerType string
|
StickerType string
|
||||||
Emojis 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
|
||||||
ContainsMasks bool // deprecated
|
|
||||||
MaskPosition *MaskPosition
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (config NewStickerSetConfig) method() string {
|
func (config NewStickerSetConfig) method() string {
|
||||||
|
@ -2187,11 +2193,10 @@ func (config NewStickerSetConfig) params() (Params, error) {
|
||||||
params.AddNonZero64("user_id", config.UserID)
|
params.AddNonZero64("user_id", config.UserID)
|
||||||
params["name"] = config.Name
|
params["name"] = config.Name
|
||||||
params["title"] = config.Title
|
params["title"] = config.Title
|
||||||
params["emojis"] = config.Emojis
|
|
||||||
|
|
||||||
params.AddBool("contains_masks", config.ContainsMasks)
|
params.AddBool("needs_repainting", config.NeedsRepainting)
|
||||||
params.AddNonEmpty("sticker_type", string(config.StickerType))
|
params.AddNonEmpty("sticker_type", string(config.StickerType))
|
||||||
err := params.AddInterface("mask_position", config.MaskPosition)
|
err := params.AddInterface("stickers", config.Stickers)
|
||||||
|
|
||||||
return params, err
|
return params, err
|
||||||
}
|
}
|
||||||
|
@ -2214,10 +2219,7 @@ func (config NewStickerSetConfig) files() []RequestFile {
|
||||||
type AddStickerConfig struct {
|
type AddStickerConfig struct {
|
||||||
UserID int64
|
UserID int64
|
||||||
Name string
|
Name string
|
||||||
PNGSticker RequestFileData
|
Sticker InputSticker
|
||||||
TGSSticker RequestFileData
|
|
||||||
Emojis string
|
|
||||||
MaskPosition *MaskPosition
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (config AddStickerConfig) method() string {
|
func (config AddStickerConfig) method() string {
|
||||||
|
@ -2229,10 +2231,7 @@ func (config AddStickerConfig) params() (Params, error) {
|
||||||
|
|
||||||
params.AddNonZero64("user_id", config.UserID)
|
params.AddNonZero64("user_id", config.UserID)
|
||||||
params["name"] = config.Name
|
params["name"] = config.Name
|
||||||
params["emojis"] = config.Emojis
|
err := params.AddInterface("sticker", config.Sticker)
|
||||||
|
|
||||||
err := params.AddInterface("mask_position", config.MaskPosition)
|
|
||||||
|
|
||||||
return params, err
|
return params, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2270,6 +2269,61 @@ func (config SetStickerPositionConfig) params() (Params, error) {
|
||||||
return params, nil
|
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.
|
// DeleteStickerConfig allows you to delete a sticker from a set.
|
||||||
type DeleteStickerConfig struct {
|
type DeleteStickerConfig struct {
|
||||||
Sticker string
|
Sticker string
|
||||||
|
@ -2287,6 +2341,63 @@ func (config DeleteStickerConfig) params() (Params, error) {
|
||||||
return params, nil
|
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.
|
// SetStickerSetThumbConfig allows you to set the thumbnail for a sticker set.
|
||||||
type SetStickerSetThumbConfig struct {
|
type SetStickerSetThumbConfig struct {
|
||||||
Name string
|
Name string
|
||||||
|
@ -2295,7 +2406,7 @@ type SetStickerSetThumbConfig struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (config SetStickerSetThumbConfig) method() string {
|
func (config SetStickerSetThumbConfig) method() string {
|
||||||
return "setStickerSetThumb"
|
return "setStickerSetThumbnail"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (config SetStickerSetThumbConfig) params() (Params, error) {
|
func (config SetStickerSetThumbConfig) params() (Params, error) {
|
||||||
|
@ -2309,7 +2420,7 @@ func (config SetStickerSetThumbConfig) params() (Params, error) {
|
||||||
|
|
||||||
func (config SetStickerSetThumbConfig) files() []RequestFile {
|
func (config SetStickerSetThumbConfig) files() []RequestFile {
|
||||||
return []RequestFile{{
|
return []RequestFile{{
|
||||||
Name: "thumb",
|
Name: "thumbnail",
|
||||||
Data: config.Thumb,
|
Data: config.Thumb,
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
|
@ -2704,6 +2815,86 @@ func (config DeleteMyCommandsConfig) params() (Params, error) {
|
||||||
return params, err
|
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,
|
// SetChatMenuButtonConfig changes the bot's menu button in a private chat,
|
||||||
// or the default menu button.
|
// or the default menu button.
|
||||||
type SetChatMenuButtonConfig struct {
|
type SetChatMenuButtonConfig struct {
|
||||||
|
|
53
helpers.go
53
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.
|
// NewVideo creates a new sendVideo request.
|
||||||
func NewVideo(chatID int64, file RequestFileData) VideoConfig {
|
func NewVideo(chatID int64, file RequestFileData) VideoConfig {
|
||||||
return VideoConfig{
|
return VideoConfig{
|
||||||
|
@ -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
|
// NewGetMyCommandsWithScope allows you to set the registered commands for a
|
||||||
// given scope.
|
// given scope.
|
||||||
func NewGetMyCommandsWithScope(scope BotCommandScope) GetMyCommandsConfig {
|
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
|
// Thumbnail animation thumbnail as defined by sender
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
Thumbnail *PhotoSize `json:"thumb,omitempty"`
|
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||||
// FileName original animation filename as defined by sender
|
// FileName original animation filename as defined by sender
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
|
@ -1002,7 +1002,7 @@ type Audio struct {
|
||||||
// Thumbnail is the album cover to which the music file belongs
|
// Thumbnail is the album cover to which the music file belongs
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
Thumbnail *PhotoSize `json:"thumb,omitempty"`
|
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Document represents a general file.
|
// Document represents a general file.
|
||||||
|
@ -1017,7 +1017,7 @@ type Document struct {
|
||||||
// Thumbnail document thumbnail as defined by sender
|
// Thumbnail document thumbnail as defined by sender
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
Thumbnail *PhotoSize `json:"thumb,omitempty"`
|
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||||
// FileName original filename as defined by sender
|
// FileName original filename as defined by sender
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
|
@ -1050,7 +1050,7 @@ type Video struct {
|
||||||
// Thumbnail video thumbnail
|
// Thumbnail video thumbnail
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
Thumbnail *PhotoSize `json:"thumb,omitempty"`
|
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||||
// FileName is the original filename as defined by sender
|
// FileName is the original filename as defined by sender
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
|
@ -1080,7 +1080,7 @@ type VideoNote struct {
|
||||||
// Thumbnail video thumbnail
|
// Thumbnail video thumbnail
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
Thumbnail *PhotoSize `json:"thumb,omitempty"`
|
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||||
// FileSize file size
|
// FileSize file size
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
|
@ -2212,6 +2212,16 @@ type BotCommandScope struct {
|
||||||
UserID int64 `json:"user_id,omitempty"`
|
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.
|
// MenuButton describes the bot's menu button in a private chat.
|
||||||
type MenuButton struct {
|
type MenuButton struct {
|
||||||
// Type is the type of menu button, must be one of:
|
// Type is the type of menu button, must be one of:
|
||||||
|
@ -2284,7 +2294,7 @@ type InputMediaVideo struct {
|
||||||
// the file is supported server-side.
|
// the file is supported server-side.
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
Thumb RequestFileData `json:"thumb,omitempty"`
|
Thumb RequestFileData `json:"thumbnail,omitempty"`
|
||||||
// Width video width
|
// Width video width
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
|
@ -2314,7 +2324,7 @@ type InputMediaAnimation struct {
|
||||||
// the file is supported server-side.
|
// the file is supported server-side.
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
Thumb RequestFileData `json:"thumb,omitempty"`
|
Thumb RequestFileData `json:"thumbnail,omitempty"`
|
||||||
// Width video width
|
// Width video width
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
|
@ -2340,7 +2350,7 @@ type InputMediaAudio struct {
|
||||||
// the file is supported server-side.
|
// the file is supported server-side.
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
Thumb RequestFileData `json:"thumb,omitempty"`
|
Thumb RequestFileData `json:"thumbnail,omitempty"`
|
||||||
// Duration of the audio in seconds
|
// Duration of the audio in seconds
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
|
@ -2362,7 +2372,7 @@ type InputMediaDocument struct {
|
||||||
// the file is supported server-side.
|
// the file is supported server-side.
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
Thumb RequestFileData `json:"thumb,omitempty"`
|
Thumb RequestFileData `json:"thumbnail,omitempty"`
|
||||||
// DisableContentTypeDetection disables automatic server-side content type
|
// DisableContentTypeDetection disables automatic server-side content type
|
||||||
// detection for files uploaded using multipart/form-data. Always true, if
|
// detection for files uploaded using multipart/form-data. Always true, if
|
||||||
// the document is sent as part of an album
|
// 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
|
// Thumbnail sticker thumbnail in the .WEBP or .JPG format
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
Thumbnail *PhotoSize `json:"thumb,omitempty"`
|
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||||
// Emoji associated with the sticker
|
// Emoji associated with the sticker
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
|
@ -2428,6 +2438,10 @@ type Sticker struct {
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
CustomEmojiID string `json:"custom_emoji_id,omitempty"`
|
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
|
// FileSize
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
|
@ -2468,7 +2482,7 @@ type StickerSet struct {
|
||||||
// Stickers list of all set stickers
|
// Stickers list of all set stickers
|
||||||
Stickers []Sticker `json:"stickers"`
|
Stickers []Sticker `json:"stickers"`
|
||||||
// Thumb is the sticker set thumbnail in the .WEBP or .TGS format
|
// 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
|
// IsRegular returns if the StickerSet is regular
|
||||||
|
@ -2504,6 +2518,22 @@ type MaskPosition struct {
|
||||||
Scale float64 `json:"scale"`
|
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
|
// Game represents a game. Use BotFather to create and edit games, their short
|
||||||
// names will act as unique identifiers.
|
// names will act as unique identifiers.
|
||||||
type Game struct {
|
type Game struct {
|
||||||
|
@ -2923,15 +2953,15 @@ type InlineQueryResultArticle struct {
|
||||||
// ThumbURL url of the thumbnail for the result
|
// ThumbURL url of the thumbnail for the result
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
ThumbURL string `json:"thumb_url,omitempty"`
|
ThumbURL string `json:"thumbnail_url,omitempty"`
|
||||||
// ThumbWidth thumbnail width
|
// ThumbWidth thumbnail width
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
ThumbWidth int `json:"thumb_width,omitempty"`
|
ThumbWidth int `json:"thumbnail_width,omitempty"`
|
||||||
// ThumbHeight thumbnail height
|
// ThumbHeight thumbnail height
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
ThumbHeight int `json:"thumb_height,omitempty"`
|
ThumbHeight int `json:"thumbnail_height,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// InlineQueryResultAudio is an inline query response audio.
|
// InlineQueryResultAudio is an inline query response audio.
|
||||||
|
@ -2987,9 +3017,9 @@ type InlineQueryResultContact struct {
|
||||||
VCard string `json:"vcard"`
|
VCard string `json:"vcard"`
|
||||||
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
|
||||||
InputMessageContent interface{} `json:"input_message_content,omitempty"`
|
InputMessageContent interface{} `json:"input_message_content,omitempty"`
|
||||||
ThumbURL string `json:"thumb_url"`
|
ThumbURL string `json:"thumbnail_url"`
|
||||||
ThumbWidth int `json:"thumb_width"`
|
ThumbWidth int `json:"thumbnail_width"`
|
||||||
ThumbHeight int `json:"thumb_height"`
|
ThumbHeight int `json:"thumbnail_height"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// InlineQueryResultGame is an inline query response game.
|
// InlineQueryResultGame is an inline query response game.
|
||||||
|
@ -3037,15 +3067,15 @@ type InlineQueryResultDocument struct {
|
||||||
// ThumbURL url of the thumbnail (jpeg only) for the file
|
// ThumbURL url of the thumbnail (jpeg only) for the file
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
ThumbURL string `json:"thumb_url,omitempty"`
|
ThumbURL string `json:"thumbnail_url,omitempty"`
|
||||||
// ThumbWidth thumbnail width
|
// ThumbWidth thumbnail width
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
ThumbWidth int `json:"thumb_width,omitempty"`
|
ThumbWidth int `json:"thumbnail_width,omitempty"`
|
||||||
// ThumbHeight thumbnail height
|
// ThumbHeight thumbnail height
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
ThumbHeight int `json:"thumb_height,omitempty"`
|
ThumbHeight int `json:"thumbnail_height,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// InlineQueryResultGIF is an inline query response GIF.
|
// 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 a valid URL for the GIF file. File size must not exceed 1MB.
|
||||||
URL string `json:"gif_url"`
|
URL string `json:"gif_url"`
|
||||||
// ThumbURL url of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result.
|
// 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
|
// Width of the GIF
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
|
@ -3143,15 +3175,15 @@ type InlineQueryResultLocation struct {
|
||||||
// ThumbURL url of the thumbnail for the result
|
// ThumbURL url of the thumbnail for the result
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
ThumbURL string `json:"thumb_url,omitempty"`
|
ThumbURL string `json:"thumbnail_url,omitempty"`
|
||||||
// ThumbWidth thumbnail width
|
// ThumbWidth thumbnail width
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
ThumbWidth int `json:"thumb_width,omitempty"`
|
ThumbWidth int `json:"thumbnail_width,omitempty"`
|
||||||
// ThumbHeight thumbnail height
|
// ThumbHeight thumbnail height
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
ThumbHeight int `json:"thumb_height,omitempty"`
|
ThumbHeight int `json:"thumbnail_height,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// InlineQueryResultMPEG4GIF is an inline query response MPEG4 GIF.
|
// InlineQueryResultMPEG4GIF is an inline query response MPEG4 GIF.
|
||||||
|
@ -3175,7 +3207,9 @@ type InlineQueryResultMPEG4GIF struct {
|
||||||
// optional
|
// optional
|
||||||
Duration int `json:"mpeg4_duration,omitempty"`
|
Duration int `json:"mpeg4_duration,omitempty"`
|
||||||
// ThumbURL url of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result.
|
// 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
|
// Title for the result
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
|
@ -3227,7 +3261,7 @@ type InlineQueryResultPhoto struct {
|
||||||
// ThumbURL url of the thumbnail for the photo.
|
// ThumbURL url of the thumbnail for the photo.
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
ThumbURL string `json:"thumb_url,omitempty"`
|
ThumbURL string `json:"thumbnail_url,omitempty"`
|
||||||
// Title for the result
|
// Title for the result
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
|
@ -3303,15 +3337,15 @@ type InlineQueryResultVenue struct {
|
||||||
// ThumbURL url of the thumbnail for the result
|
// ThumbURL url of the thumbnail for the result
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
ThumbURL string `json:"thumb_url,omitempty"`
|
ThumbURL string `json:"thumbnail_url,omitempty"`
|
||||||
// ThumbWidth thumbnail width
|
// ThumbWidth thumbnail width
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
ThumbWidth int `json:"thumb_width,omitempty"`
|
ThumbWidth int `json:"thumbnail_width,omitempty"`
|
||||||
// ThumbHeight thumbnail height
|
// ThumbHeight thumbnail height
|
||||||
//
|
//
|
||||||
// optional
|
// optional
|
||||||
ThumbHeight int `json:"thumb_height,omitempty"`
|
ThumbHeight int `json:"thumbnail_height,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// InlineQueryResultVideo is an inline query response video.
|
// InlineQueryResultVideo is an inline query response video.
|
||||||
|
@ -3327,7 +3361,7 @@ type InlineQueryResultVideo struct {
|
||||||
//
|
//
|
||||||
// ThumbURL url of the thumbnail (jpeg only) for the video
|
// ThumbURL url of the thumbnail (jpeg only) for the video
|
||||||
// optional
|
// optional
|
||||||
ThumbURL string `json:"thumb_url,omitempty"`
|
ThumbURL string `json:"thumbnail_url,omitempty"`
|
||||||
// Title for the result
|
// Title for the result
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
// Caption of the video to be sent, 0-1024 characters after entities parsing
|
// Caption of the video to be sent, 0-1024 characters after entities parsing
|
||||||
|
|
Loading…
Reference in New Issue