Add support for Markdown/HTML in NewInlineQueryResultArticle
Maxim Martyanov me@llorephie.org
Thu, 02 Jun 2016 22:42:05 +0300
2 files changed,
5 insertions(+),
3 deletions(-)
M
helpers.go
→
helpers.go
@@ -317,13 +317,14 @@ }
} // NewInlineQueryResultArticle creates a new inline query article. -func NewInlineQueryResultArticle(id, title, messageText string) InlineQueryResultArticle { +func NewInlineQueryResultArticle(id, title, messageText string, parseMode string) InlineQueryResultArticle { return InlineQueryResultArticle{ Type: "article", ID: id, Title: title, InputMessageContent: InputTextMessageContent{ Text: messageText, + ParseMode: parseMode, }, } }
M
helpers_test.go
→
helpers_test.go
@@ -6,12 +6,13 @@ "testing"
) func TestNewInlineQueryResultArticle(t *testing.T) { - result := tgbotapi.NewInlineQueryResultArticle("id", "title", "message") + result := tgbotapi.NewInlineQueryResultArticle("id", "title", "message", "Markdown") if result.Type != "article" || result.ID != "id" || result.Title != "title" || - result.InputMessageContent.(tgbotapi.InputTextMessageContent).Text != "message" { + result.InputMessageContent.(tgbotapi.InputTextMessageContent).Text != "message" || + result.InputMessageContent.(tgbotapi.InputTextMessageContent).ParseMode != "Markdown" { t.Fail() } }