Skip to content

Commit 97c4ff4

Browse files
Add input media types documentation
1 parent d885b2a commit 97c4ff4

File tree

1 file changed

+51
-10
lines changed

1 file changed

+51
-10
lines changed

types.go

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,23 +1109,64 @@ func (info WebhookInfo) IsSet() bool {
11091109

11101110
// InputMediaPhoto contains a photo for displaying as part of a media group.
11111111
type InputMediaPhoto struct {
1112-
Type string `json:"type"`
1113-
Media string `json:"media"`
1114-
Caption string `json:"caption"`
1112+
// Type of the result, must be photo.
1113+
Type string `json:"type"`
1114+
// Media file to send. Pass a file_id to send a file that
1115+
// exists on the Telegram servers (recommended),
1116+
// pass an HTTP URL for Telegram to get a file from the Internet,
1117+
// or pass “attach://<file_attach_name>” to upload a new one
1118+
// using multipart/form-data under <file_attach_name> name.
1119+
Media string `json:"media"`
1120+
// Caption of the photo to be sent, 0-1024 characters after entities parsing.
1121+
//
1122+
// optional
1123+
Caption string `json:"caption"`
1124+
// ParseMode mode for parsing entities in the photo caption.
1125+
// See formatting options for more details
1126+
// (https://core.telegram.org/bots/api#formatting-options).
1127+
//
1128+
// optional
11151129
ParseMode string `json:"parse_mode"`
11161130
}
11171131

11181132
// InputMediaVideo contains a video for displaying as part of a media group.
11191133
type InputMediaVideo struct {
1120-
Type string `json:"type"`
1134+
// Type of the result, must be video.
1135+
Type string `json:"type"`
1136+
// Media file to send. Pass a file_id to send a file
1137+
// that exists on the Telegram servers (recommended),
1138+
// pass an HTTP URL for Telegram to get a file from the Internet,
1139+
// or pass “attach://<file_attach_name>” to upload a new one
1140+
// using multipart/form-data under <file_attach_name> name.
11211141
Media string `json:"media"`
11221142
// thumb intentionally missing as it is not currently compatible
1123-
Caption string `json:"caption"`
1124-
ParseMode string `json:"parse_mode"`
1125-
Width int `json:"width"`
1126-
Height int `json:"height"`
1127-
Duration int `json:"duration"`
1128-
SupportsStreaming bool `json:"supports_streaming"`
1143+
1144+
// Caption of the video to be sent, 0-1024 characters after entities parsing.
1145+
//
1146+
// optional
1147+
Caption string `json:"caption"`
1148+
// ParseMode mode for parsing entities in the video caption.
1149+
// See formatting options for more details
1150+
// (https://core.telegram.org/bots/api#formatting-options).
1151+
//
1152+
// optional
1153+
ParseMode string `json:"parse_mode"`
1154+
// Width video width
1155+
//
1156+
// optional
1157+
Width int `json:"width"`
1158+
// Height video height
1159+
//
1160+
// optional
1161+
Height int `json:"height"`
1162+
// Duration video duration
1163+
//
1164+
// optional
1165+
Duration int `json:"duration"`
1166+
// SupportsStreaming pass True, if the uploaded video is suitable for streaming.
1167+
//
1168+
// optional
1169+
SupportsStreaming bool `json:"supports_streaming"`
11291170
}
11301171

11311172
// InlineQuery is a Query from Telegram for an inline request.

0 commit comments

Comments
 (0)