Add support for editing inline messages
This commit is contained in:
parent
e51fe7f419
commit
dfbd036217
2 changed files with 8 additions and 3 deletions
|
@ -106,6 +106,7 @@ type ClientAlbumData struct {
|
|||
type ClientEditMediaData struct {
|
||||
ChatID int64
|
||||
MessageID int64
|
||||
InlineID string
|
||||
Media interface{}
|
||||
ReplyMarkup interface{} `json:",omitempty"`
|
||||
}
|
||||
|
|
|
@ -220,10 +220,14 @@ func (t Telegram) EditMedia(data ClientEditMediaData) {
|
|||
checkerr("SendAlbum/json.Marshal", err)
|
||||
}
|
||||
postdata := url.Values{
|
||||
"chat_id": {strconv.FormatInt(data.ChatID, 10)},
|
||||
"message_id": {strconv.FormatInt(data.MessageID, 10)},
|
||||
"media": {string(jsonmedia)},
|
||||
}
|
||||
if data.InlineID != "" {
|
||||
postdata.Set("inline_message_id", data.InlineID)
|
||||
} else {
|
||||
postdata.Set("chat_id", strconv.FormatInt(data.ChatID, 10))
|
||||
postdata.Set("message_id", strconv.FormatInt(data.MessageID, 10))
|
||||
}
|
||||
if data.ReplyMarkup != nil {
|
||||
replyjson, err := json.Marshal(data.ReplyMarkup)
|
||||
if !checkerr("SendTextMessage/json.Marshal", err) {
|
||||
|
|
Loading…
Reference in a new issue