|
|
|
@ -2,6 +2,7 @@ package tgbotapi |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"encoding/json" |
|
|
|
"encoding/json" |
|
|
|
|
|
|
|
"fmt" |
|
|
|
"io" |
|
|
|
"io" |
|
|
|
"net/url" |
|
|
|
"net/url" |
|
|
|
"strconv" |
|
|
|
"strconv" |
|
|
|
@ -1151,7 +1152,7 @@ type MediaGroupConfig struct { |
|
|
|
ChatID int64 |
|
|
|
ChatID int64 |
|
|
|
ChannelUsername string |
|
|
|
ChannelUsername string |
|
|
|
|
|
|
|
|
|
|
|
Media []interface{} |
|
|
|
Media []interface{} `json:"media"` |
|
|
|
DisableNotification bool |
|
|
|
DisableNotification bool |
|
|
|
ReplyToMessageID int |
|
|
|
ReplyToMessageID int |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1170,6 +1171,7 @@ func (config MediaGroupConfig) values() (url.Values, error) { |
|
|
|
} |
|
|
|
} |
|
|
|
bytes, err := json.Marshal(config.Media) |
|
|
|
bytes, err := json.Marshal(config.Media) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
|
|
|
|
fmt.Println(err) |
|
|
|
return v, err |
|
|
|
return v, err |
|
|
|
} |
|
|
|
} |
|
|
|
v.Add("media", string(bytes)) |
|
|
|
v.Add("media", string(bytes)) |
|
|
|
@ -1184,19 +1186,19 @@ func (config MediaGroupConfig) values() (url.Values, error) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type InputMediaPhoto struct { |
|
|
|
type InputMediaPhoto struct { |
|
|
|
Type string |
|
|
|
Type string |
|
|
|
Media string |
|
|
|
Media string |
|
|
|
Caption string |
|
|
|
Caption string |
|
|
|
ParseMode string |
|
|
|
ParseMode string |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type InputMediaVideo struct { |
|
|
|
type InputMediaVideo struct { |
|
|
|
Type string |
|
|
|
Type string |
|
|
|
Media string |
|
|
|
Media string |
|
|
|
Caption string |
|
|
|
Caption string |
|
|
|
ParseMode string |
|
|
|
ParseMode string |
|
|
|
Width int |
|
|
|
Width int |
|
|
|
Height int |
|
|
|
Height int |
|
|
|
Duration int |
|
|
|
Duration int |
|
|
|
SupportsStreaming bool |
|
|
|
SupportsStreaming bool |
|
|
|
} |
|
|
|
} |