all repos — telegram-bot-api @ f90493fac6ee3a4cc3918d3edb4da1f7999acc38

Golang bindings for the Telegram Bot API

Add ParseMode to EditMessageCaption
Amir Khazaie 733amir@gmail.com
Sat, 30 Jun 2018 11:01:59 +0430
commit

f90493fac6ee3a4cc3918d3edb4da1f7999acc38

parent

4c16a90966d12d963e19e4df99e7744c191d0e79

3 files changed, 8 insertions(+), 4 deletions(-)

jump to
M configs.goconfigs.go

@@ -793,13 +793,15 @@

// EditMessageCaptionConfig allows you to modify the caption of a message. type EditMessageCaptionConfig struct { BaseEdit - Caption string + Caption string + ParseMode string } func (config EditMessageCaptionConfig) values() (url.Values, error) { v, _ := config.BaseEdit.values() v.Add("caption", config.Caption) + v.Add("parse_mode", config.ParseMode) return v, nil }
M helpers.gohelpers.go

@@ -494,13 +494,14 @@ }

} // NewEditMessageCaption allows you to edit the caption of a message. -func NewEditMessageCaption(chatID int64, messageID int, caption string) EditMessageCaptionConfig { +func NewEditMessageCaption(chatID int64, messageID int, caption, parseMode string) EditMessageCaptionConfig { return EditMessageCaptionConfig{ BaseEdit: BaseEdit{ ChatID: chatID, MessageID: messageID, }, - Caption: caption, + Caption: caption, + ParseMode: parseMode, } }
M helpers_test.gohelpers_test.go

@@ -148,9 +148,10 @@ }

} func TestNewEditMessageCaption(t *testing.T) { - edit := tgbotapi.NewEditMessageCaption(ChatID, ReplyToMessageID, "new caption") + edit := tgbotapi.NewEditMessageCaption(ChatID, ReplyToMessageID, "new caption", tgbotapi.ModeHTML) if edit.Caption != "new caption" || + edit.ParseMode != tgbotapi.ModeHTML || edit.BaseEdit.ChatID != ChatID || edit.BaseEdit.MessageID != ReplyToMessageID { t.Fail()