Merge pull request #347 from greenx/master

add MarkdownV2
bot-api-6.1
Syfaro 2020-07-21 01:32:00 -05:00 committed by GitHub
commit 16a589d239
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -37,6 +37,7 @@ const (
// Constant values for ParseMode in MessageConfig // Constant values for ParseMode in MessageConfig
const ( const (
ModeMarkdown = "Markdown" ModeMarkdown = "Markdown"
ModeMarkdownV2 = "MarkdownV2"
ModeHTML = "HTML" ModeHTML = "HTML"
) )

View File

@ -438,6 +438,19 @@ func NewInlineQueryResultArticleMarkdown(id, title, messageText string) InlineQu
} }
} }
// 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. // NewInlineQueryResultArticleHTML creates a new inline query article with HTML parsing.
func NewInlineQueryResultArticleHTML(id, title, messageText string) InlineQueryResultArticle { func NewInlineQueryResultArticleHTML(id, title, messageText string) InlineQueryResultArticle {
return InlineQueryResultArticle{ return InlineQueryResultArticle{