all repos — telegram-bot-api @ a7f48eb2dd301356942677e65bebe0c9aef07013

Golang bindings for the Telegram Bot API

Merge pull request #55 from tucher/master

Fixed BaseEdit.values
Syfaro syfaro@foxpaw.in
Mon, 01 Aug 2016 13:36:25 -0500
commit

a7f48eb2dd301356942677e65bebe0c9aef07013

parent

4f996f7f277d290fb753a72c125cd4c8186634e8

1 files changed, 8 insertions(+), 5 deletions(-)

jump to
M configs.goconfigs.go

@@ -166,13 +166,16 @@

func (edit BaseEdit) values() (url.Values, error) { v := url.Values{} - if edit.ChannelUsername != "" { - v.Add("chat_id", edit.ChannelUsername) + if edit.InlineMessageID == "" { + if edit.ChannelUsername != "" { + v.Add("chat_id", edit.ChannelUsername) + } else { + v.Add("chat_id", strconv.FormatInt(edit.ChatID, 10)) + } + v.Add("message_id", strconv.Itoa(edit.MessageID)) } else { - v.Add("chat_id", strconv.FormatInt(edit.ChatID, 10)) + v.Add("inline_message_id", edit.InlineMessageID) } - v.Add("message_id", strconv.Itoa(edit.MessageID)) - v.Add("inline_message_id", edit.InlineMessageID) if edit.ReplyMarkup != nil { data, err := json.Marshal(edit.ReplyMarkup)