all repos — telegram-bot-api @ 16a589d2390bd5813a4e5fcab296448c0f7b4934

Golang bindings for the Telegram Bot API

Merge pull request #347 from greenx/master

add MarkdownV2
Syfaro syfaro@huefox.com
Tue, 21 Jul 2020 01:32:00 -0500
commit

16a589d2390bd5813a4e5fcab296448c0f7b4934

parent

74b3b6300b477782c82f919ba96bcaeaed43c1d6

2 files changed, 16 insertions(+), 2 deletions(-)

jump to
M configs.goconfigs.go

@@ -36,8 +36,9 @@ )

// Constant values for ParseMode in MessageConfig const ( - ModeMarkdown = "Markdown" - ModeHTML = "HTML" + ModeMarkdown = "Markdown" + ModeMarkdownV2 = "MarkdownV2" + ModeHTML = "HTML" ) // Library errors
M helpers.gohelpers.go

@@ -438,6 +438,19 @@ },

} } +// NewInlineQueryResultArticleMarkdownV2 creates a new inline query article with MarkdownV2 parsing. +func NewInlineQueryResultArticleMarkdownV2(id, title, messageText string) InlineQueryResultArticle { + return InlineQueryResultArticle{ + Type: "article", + ID: id, + Title: title, + InputMessageContent: InputTextMessageContent{ + Text: messageText, + ParseMode: "MarkdownV2", + }, + } +} + // NewInlineQueryResultArticleHTML creates a new inline query article with HTML parsing. func NewInlineQueryResultArticleHTML(id, title, messageText string) InlineQueryResultArticle { return InlineQueryResultArticle{