(new): rich message support
Golang lint / lint (pull_request) Successful in 1m20s
Golang lint / lint (push) Successful in 4m8s

(fix): runtime reliability
(tests): regression coverage
(doc): v1.1 release notes
This commit is contained in:
2026-08-12 16:34:44 +03:00
parent 48ddf66540
commit f03a081ed6
83 changed files with 6122 additions and 1925 deletions
+27 -12
View File
@@ -112,9 +112,13 @@ type PaidMediaInfo struct {
type PaidMediaType string
const (
PaidMediaPreviewType PaidMediaType = "preview"
PaidMediaPhotoType PaidMediaType = "photo"
PaidMediaVideoType PaidMediaType = "video"
// PaidMediaPreviewType identifies a paid-media preview.
PaidMediaPreviewType PaidMediaType = "preview"
// PaidMediaPhotoType identifies a paid photo.
PaidMediaPhotoType PaidMediaType = "photo"
// PaidMediaVideoType identifies a paid video.
PaidMediaVideoType PaidMediaType = "video"
// PaidMediaLivePhotoType identifies a paid live photo.
PaidMediaLivePhotoType PaidMediaType = "live_photo" // Since: Bot API 10.0
)
@@ -172,7 +176,8 @@ type PollOption struct {
type InputPollOptionMedia struct {
Type string `json:"type"`
Media string `json:"media,omitempty"`
URL string `json:"url,omitempty"` // Since: Bot API 10.1; for type "link"
// URL contains the HTTP URL.
URL string `json:"url,omitempty"` // Since: Bot API 10.1; for type "link"
}
// InputPollOption contains information about one answer option in a poll to be sent.
@@ -226,8 +231,8 @@ const (
// See https://core.telegram.org/bots/api#pollanswer
type PollAnswer struct {
PollID string `json:"poll_id"`
VoterChat Chat `json:"voter_chat"` // Since: Bot API 6.8
User User `json:"user"`
VoterChat Chat `json:"voter_chat,omitempty"` // Since: Bot API 6.8
User User `json:"user,omitempty"` // FIXME: Pointer in v2
OptionIDs []int `json:"option_ids"`
OptionPersistentIDs []string `json:"option_persistent_ids"` // Since: Bot API 9.6
}
@@ -264,15 +269,17 @@ type Poll struct {
// Since: Bot API 10.1
// See https://core.telegram.org/bots/api#link
type Link struct {
// URL contains the HTTP URL.
URL string `json:"url"`
}
// PollMedia represents media attached to a poll.
// Since: Bot API 10.0
type PollMedia struct {
Animation *Animation `json:"animation,omitempty"`
Audio *Audio `json:"audio,omitempty"`
Document *Document `json:"document,omitempty"`
Animation *Animation `json:"animation,omitempty"`
Audio *Audio `json:"audio,omitempty"`
Document *Document `json:"document,omitempty"`
// Link contains link media attached to the poll.
Link *Link `json:"link,omitempty"` // Since: Bot API 10.1
LivePhoto *LivePhoto `json:"live_photo,omitempty"`
Location *Location `json:"location,omitempty"`
@@ -352,10 +359,18 @@ const (
InputMediaTypeVideo InputMediaType = "video"
// InputMediaTypeAudio is an audio file.
InputMediaTypeAudio InputMediaType = "audio"
// InputMediaTypeVoiceNote is a voice message.
//
// Since: Bot API 10.2
InputMediaTypeVoiceNote InputMediaType = "voice_note"
InputMediaTypeSticker InputMediaType = "sticker"
InputMediaTypeLocation InputMediaType = "location"
InputMediaTypeVenue InputMediaType = "venue"
// InputMediaTypeSticker is a sticker.
InputMediaTypeSticker InputMediaType = "sticker"
// InputMediaTypeLocation is a location.
InputMediaTypeLocation InputMediaType = "location"
// InputMediaTypeVenue is a venue.
InputMediaTypeVenue InputMediaType = "venue"
// InputMediaTypeLivePhoto is a live photo.
InputMediaTypeLivePhoto InputMediaType = "live_photo" // Since: Bot API 10.0
)