module Tourmaline::Helpers

Extended Modules

Defined in:

Constant Summary

DEFAULT_EXTENSIONS = {audio: "mp3", photo: "jpg", sticker: "webp", video: "mp4", animation: "mp4", video_note: "mp4", voice: "ogg"}
HTML_ENTITY_MAP = {"bold" => {"<b>", "</b>"}, "italic" => {"<i>", "</i>"}, "underline" => {"<u>", "</u>"}, "code" => {"<code>", "</code>"}, "pre" => {"<pre>\n", "\n</pre>"}, "pre_language" => {"<pre><code class=\"language-{language}\">\n", "\n</code></pre>"}, "strikethrough" => {"<s>", "</s>"}, "text_mention" => {"<a href=\"tg://user?id={id}\">", "</a>"}, "text_link" => {"<a href=\"{url}\">", "</a>"}}
MD_ENTITY_MAP = {"bold" => {"*", "*"}, "italic" => {"_", "_"}, "underline" => {"", ""}, "code" => {"`", "`"}, "pre" => {"```\n", "\n```"}, "pre_language" => {"```{language}\n", "\n```"}, "strikethrough" => {"", ""}, "text_mention" => {"[", "](tg://user?id={id})"}, "text_link" => {"[", "]({url})"}}
MDV2_ENTITY_MAP = {"bold" => {"*", "*"}, "italic" => {"_", "_"}, "underline" => {"__", "__"}, "code" => {"`", "`"}, "pre" => {"```\n", "\n```"}, "pre_language" => {"```{language}\n", "\n```"}, "strikethrough" => {"~", "~"}, "text_mention" => {"[", "](tg://user?id={id})"}, "text_link" => {"[", "]({url})"}}

Instance Method Summary

Instance Method Detail

def escape_md(text, version = 1) #

def random_string(length) #

def unparse_text(text : String, entities ents : Array(MessageEntity), parse_mode : ParseMode = :markdown) #