diff --git a/api.go b/api.go index f93fdbe..9b87ebe 100644 --- a/api.go +++ b/api.go @@ -95,6 +95,10 @@ func embedSendOptions(params *url.Values, options *SendOptions) { params.Set("disable_web_page_preview", "true") } + if options.ParseMode != ModeDefault { + params.Set("parse_mode", string(options.ParseMode)) + } + // process reply_markup if options.ReplyMarkup.ForceReply || options.ReplyMarkup.CustomKeyboard != nil || options.ReplyMarkup.HideCustomKeyboard { replyMarkup, _ := json.Marshal(options.ReplyMarkup) diff --git a/options.go b/options.go index 1cb82b7..915275e 100644 --- a/options.go +++ b/options.go @@ -1,5 +1,14 @@ package telebot +// ParseMode determines the way client applications treat the text of the message +type ParseMode string + +// Supported ParseMode +const ( + ModeDefault ParseMode = "" + ModeMarkdown ParseMode = "Markdown" +) + // SendOptions represents a set of custom options that could // be appled to messages sent. type SendOptions struct { @@ -11,6 +20,9 @@ type SendOptions struct { // For text messages, disables previews for links in this message. DisableWebPagePreview bool + + // ParseMode controls how client apps render your message. + ParseMode ParseMode } type ReplyMarkup struct {