{"id":15130860,"url":"https://github.com/aeurum/teleform","last_synced_at":"2026-02-14T23:07:32.885Z","repository":{"id":255866107,"uuid":"849246233","full_name":"aeurum/teleform","owner":"aeurum","description":"Format Telegram messages, escape special characters, switch formatting styles, convert special entities to formatted text and vice versa, form Telegram links, use Unicode symbols.","archived":false,"fork":false,"pushed_at":"2025-04-05T06:42:56.000Z","size":91,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T07:27:39.705Z","etag":null,"topics":["conversion","escaping","formatting","html","markdown","markdownv2","markup","telegram","unicode"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aeurum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-29T08:46:54.000Z","updated_at":"2025-04-05T06:42:59.000Z","dependencies_parsed_at":"2024-09-15T18:00:44.622Z","dependency_job_id":null,"html_url":"https://github.com/aeurum/teleform","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"d34bc7641747d4fa242296867b7fcfbf7f922adb"},"previous_names":["aeurum/teleform"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeurum%2Fteleform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeurum%2Fteleform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeurum%2Fteleform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeurum%2Fteleform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aeurum","download_url":"https://codeload.github.com/aeurum/teleform/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393572,"owners_count":20931813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conversion","escaping","formatting","html","markdown","markdownv2","markup","telegram","unicode"],"created_at":"2024-09-26T03:07:28.753Z","updated_at":"2026-02-14T23:07:32.879Z","avatar_url":"https://github.com/aeurum.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Teleform\nTeleform can help you format Telegram messages, escape special characters, switch formatting styles, convert special entities to formatted text and vice versa, form Telegram links, and use Unicode symbols.\n\n## Installation\n```\nnpm i teleform\n```\n\n## Usage\n```\nconst {\n  STYLES, PARSE_MODES,\n  mdv2, md, html, mdv1,\n  link, telink,\n  symbol, sm,\n  spaces, ls,\n  newlines, ln\n} = require('teleform')\n/*\nimport {\n  STYLES, PARSE_MODES,\n  mdv2, md, html, mdv1,\n  link, telink,\n  symbol, sm,\n  spaces, ls,\n  newlines, ln\n} from 'teleform'\n*/\n\nconsole.log(STYLES === PARSE_MODES) // true\nconsole.log(md === mdv2)            // true\nconsole.log(telink === link)        // true\nconsole.log(sm === symbol)          // true\nconsole.log(ls === spaces)          // true\nconsole.log(ln === newlines)        // true\n```\n\n### Formatting\nYou can use Markdown-style or HTML-style formatting.\n\n#### Markdown\nNote that entities must not be nested; and that escaping inside entities is not allowed, so an entity must be closed first and reopened again.\n```\nconst result = { text: [\n  mdv1.bold('_bold_'),\n  // mdv1.bold('2 * 2 = 4'), // will fail\n  mdv1.b('2 ') + mdv1.escape('*') + mdv1.b(' 2 = 4'),\n  mdv1.italic('*italic*'),\n  // mdv1.italic('snake_case'), // will fail\n  mdv1.i('snake') + mdv1.escape('_') + mdv1.i('case'),\n  mdv1.link('*_link_*', 'http://www.example.com/'),\n  mdv1.link('link with ‘\\\\’', 'http://www.example.com//\\\\'),\n  // mdv1.link('will fail', 'http://www.example.com/()'),\n  mdv1.mention('*_mention_*', 1234567890),\n  mdv1.code('code'),\n  mdv1.pre('code block'),\n  mdv1.pre('console.log(\"javascript code block\")', 'javascript')\n].join(newlines()) }\n```\n\n#### HTML\nNote that custom emoji entities can only be used by bots that purchased additional usernames on [Fragment](https://fragment.com/).\n```\nconst result = { text: [\n  html.bold('\u003cbold\u003e'),\n  html.strong('\u003cstrong\u003e'),\n  html.italic('\u003citalic\u003e'),\n  html.emphasis('\u003cemphasis\u003e'),\n  html.em('\u003calso emphasis\u003e'),\n  html.underline('\u003cunderline\u003e'),\n  html.b(html.i(html.u('\u003cbold italic underline\u003e'), false), false),\n  html.inserted('\u003cinserted\u003e'),\n  html.ins('\u003calso inserted\u003e'),\n  html.strikethrough('\u003cstrikethrough\u003e'),\n  html.strike('\u003calso strikethrough\u003e'),\n  html.deleted('\u003cdeleted\u003e'),\n  html.del('\u003calso deleted\u003e'),\n  html.spoiler('\u003cspoiler\u003e'),\n  html.telegram_spoiler('\u003ctelegram spoiler\u003e'),\n  html.text_link('\u003clink\u003e', 'http://www.example.com/'),\n  html.text_mention('\u003cmention\u003e', 1234567890),\n  html.custom_emoji('👍', 5368324170671202286),\n  html.blockquote('\u003cblockquote first line\u003e\\n' +\n                  '\u003cblockquote second line\u003e\\n' +\n                  '\u003cblockquote third line\u003e\\n' +\n                  '\u003cblockquote fourth line\u003e'),\n  html.blockquote('\u003cexpandable blockquote first line\u003e\\n' +\n                  '\u003cexpandable blockquote second line\u003e\\n' +\n                  '\u003cexpandable blockquote third line\u003e\\n' +\n                  '\u003cexpandable blockquote fourth line\u003e', true),\n  html.code('\u003ccode\u003e'),\n  html.pre('\u003ccode block\u003e'),\n  html.pre('true \u0026\u0026 console.log(\"javascript code block\")', 'javascript')\n].join(newlines()) }\n```\n\n#### MarkdownV2\nNote that in case of ambiguity between `italic` and `underline` entities, `__` is always greadily treated from left to right.\n```\nconst result = { text: [\n  md.b('*bold*'),\n  md.i('_italic_'),\n  md.u('__underline__'),\n  // md.b(md.i(md.u('*_bold italic underline_*'), 0), 0), // will fail\n  md.b(md.i(md.b('') + md.u('*_bold italic underline_*'), false), false),\n  md.s('~strikethrough~'),\n  md.spoiler('||spoiler||'),\n  md.link('[website](link)', 'http://www.example.com/'),\n  md.link('website link with ‘\\\\’', 'http://www.example.com//\\\\'),\n  md.link('website link with ‘)’', 'http://www.example.com/()'),\n  md.mention('[user](mention)', 1234567890),\n  md.emoji('👍', 5368324170671202286),\n  md.quote('\u003eblockquote first line\\n' +\n            '\u003eblockquote second line\\n' +\n            '\u003eblockquote third line\\n' +\n            '\u003eblockquote fourth line'),\n  md.quote('\u003eexpandable blockquote first line\\n' +\n            '\u003eexpandable blockquote second line\\n' +\n            '\u003eexpandable blockquote third line\\n' +\n            '\u003eexpandable blockquote fourth line||', true),\n  md.code('`code`'),\n  md.pre('```code block```'),\n  md.pre('true \u0026\u0026 console.log(\"```javascript code block```\")', 'javascript')\n].join(ln()) }\n```\n\n### Escaping\nYou can use `.escape()` methods to escape special characters.\n```\n.escape(\n  string      text,\n  array|true  characters_to_be_excluded = [ ],\n  boolean     must_escape = true,\n  array       the_only_characters_to_be_escaped = [ ]\n)\n```\n\n#### Markdown\nUse `mdv1.escape()` to escape special characters outside of entities.\n```\nconst text = '[*_`just plain text`_*]'\nconst result = { text: mdv1.escape(text) }\n```\n\n#### HTML\nUse `html.escape()` to replace special characters with HTML entities.\n```\nconst text = '\u003c\u0026 just plain text \u0026\u003e'\nconst result = { text: html.escape(text) }\n```\n\n#### MarkdownV2\nUse `md.escape()` to escape special characters anywhere in the message.\n```\nconst text = '([{ \\\\~_=/ | `_\u003e ' +\n             'just plain text' +\n             ' -_* ! \\\\+_#/ }])'\nconst result = { text: md.escape(text) }\n```\nYou can also escape Markdown-formatted text, which may contain ‘*’, ‘_’, ‘__’, ‘~’, ‘||’ and ‘`’ special characters.\n```\nconst result = { text: md.escape(\n  '*Hello!*\\n\\n' +\n  'Have you __had to__ ~escape _special characters_~ in your locale file?\\n' +\n  'Guess what? ||You need to do it no longer!||\\n' +\n  'Now you can use regular Markdown text alongside ‘\\\\*’, ‘\\\\_’, etc.',\n  true\n) }\n```\n\n### Unescaping\nIf you need to unescape special characters, you can.\n```\nconst mdv1Text = '[*_`just plain text`_*]'\nconst htmlText = '\u003c\u0026 just plain text \u0026\u003e'\nconst mdv2Text = '([{ \\\\~_=/ | `_\u003e just plain text -_* ! \\\\+_#/ }])'\n\nconst mdv1TextEscaped = mdv1.escape(mdv1Text)\nconst htmlTextEscaped = html.escape(htmlText)\nconst mdv2TextEscaped = mdv2.escape(mdv2Text)\n\nconsole.log(mdv1Text === mdv1.unescape(mdv1TextEscaped)) // true\nconsole.log(htmlText === html.unescape(htmlTextEscaped)) // true\nconsole.log(mdv2Text === mdv2.unescape(mdv2TextEscaped)) // true\n```\n\n### Switch\nYou can switch text formatting styles.\n\n#### Markdown to HTML\n```\nconst text = '\u003c\u0026 *just bold text* \u0026\u003e'\nconst result = { text: mdv1.to_html(text) }\n```\n\n#### HTML to MarkdownV2\n```\nconst text = '([{ \\\\~_=/ | `_\u003e ' +\n             '\u003cb\u003ebold \u003ci\u003eitalic \u003cu\u003eunderline\u003c/u\u003e\u003c/i\u003e\u003c/b\u003e' +\n             ' -_* ! \\\\+_#/ }])'\nconst result = { text: html.to_md(text) }\n```\n\n#### MarkdownV2 to HTML\n```\nconst text = '\u003c\u0026 *bold _italic __underline___* \u0026\\\\\u003e'\nconst result = { text: md.to_html(text) }\n```\n\n### Conversion\nYou can convert special entities to formatted text and vice versa.\n\n#### Entities to Text\n\n##### From Message\n```\nconst message // telegram message\n\nconst results = [\n  mdv1.from_entities(message),\n  html.from_entities(message),\n  mdv2.from_entities(message),\n]\n// [ { [ text | caption ]: [ formatted text ] } ]\n```\n\n##### From Variables\n\n###### Markdown\n```\nconst text = 'bold\\nitalic\\nlink\\nmention\\ncode\\npre\\nformatted'\nconst entities = [\n  { offset: 0, length: 4, type: 'bold' },\n  { offset: 5, length: 6, type: 'italic' },\n  {\n    offset: 12,\n    length: 4,\n    type: 'text_link',\n    url: 'http://www.example.com/'\n  },\n  {\n    offset: 17,\n    length: 7,\n    type: 'text_mention',\n    user: { id: 1234567890 }\n  },\n  { offset: 25, length: 4, type: 'code' },\n  { offset: 30, length: 3, type: 'pre' },\n  { offset: 34, length: 9, type: 'pre', language: 'markup' }\n]\n\nconst result = mdv1.from_entities(text, entities)\n// { [ text | caption ]: [ formatted text ] }\n```\n\n###### HTML\n```\nconst text = 'bold\\nitalic\\nunderline\\n' +\n    'strikethrough\\nspoiler\\nlink\\nmention\\ncode\\n' +\n    'b\\nl\\no\\nc\\nk\\nq\\nu\\no\\nt\\ne\\npre\\nformatted'\nconst entities = [\n  { offset: 0, length: 5, type: 'bold' },\n  { offset: 5, length: 7, type: 'bold' },\n  { offset: 5, length: 7, type: 'italic' },\n  { offset: 12, length: 9, type: 'bold' },\n  { offset: 12, length: 9, type: 'italic' },\n  { offset: 12, length: 9, type: 'underline' },\n  { offset: 22, length: 13, type: 'strikethrough' },\n  { offset: 36, length: 7, type: 'spoiler' },\n  {\n    offset: 44,\n    length: 4,\n    type: 'text_link',\n    url: 'http://www.example.com/'\n  },\n  {\n    offset: 49,\n    length: 7,\n    type: 'text_mention',\n    user: { id: 1234567890 }\n  },\n  { offset: 57, length: 4, type: 'code' },\n  { offset: 62, length: 9, type: 'blockquote' },\n  { offset: 72, length: 9, type: 'expandable_blockquote' },\n  { offset: 82, length: 3, type: 'pre' },\n  { offset: 86, length: 9, type: 'pre', language: 'markup' }\n]\n\nconst result = html.from_entities(text, entities)\n// { [ text | caption ]: [ formatted text ] }\n```\n\n###### MarkdownV2\n```\nconst text = 'bold\\nitalic\\nunderline\\n' +\n    'strikethrough\\nspoiler\\nlink\\nmention\\ncode\\n' +\n    'b\\nl\\no\\nc\\nk\\nq\\nu\\no\\nt\\ne\\npre\\nformatted'\nconst entities = [\n  { offset: 0, length: 5, type: 'bold' },\n  { offset: 5, length: 7, type: 'bold' },\n  { offset: 5, length: 7, type: 'italic' },\n  { offset: 12, length: 9, type: 'bold' },\n  { offset: 12, length: 9, type: 'italic' },\n  { offset: 12, length: 9, type: 'underline' },\n  { offset: 22, length: 13, type: 'strikethrough' },\n  { offset: 36, length: 7, type: 'spoiler' },\n  {\n    offset: 44,\n    length: 4,\n    type: 'text_link',\n    url: 'http://www.example.com/'\n  },\n  {\n    offset: 49,\n    length: 7,\n    type: 'text_mention',\n    user: { id: 1234567890 }\n  },\n  { offset: 57, length: 4, type: 'code' },\n  { offset: 62, length: 9, type: 'blockquote' },\n  { offset: 72, length: 9, type: 'expandable_blockquote' },\n  { offset: 82, length: 3, type: 'pre' },\n  { offset: 86, length: 9, type: 'pre', language: 'markup' }\n]\n\nconst result = md.from_entities(text, entities)\n// { [ text | caption ]: [ formatted text ] }\n```\n\n#### Text to Entities\n\n##### From Message\n```\nconst message // telegram message\n\nconst results = [\n  mdv1.to_entities(message),\n  html.to_entities(message),\n  mdv2.to_entities(message),\n]\n/*\n[\n  {\n    [ text | caption ]: [ plain text ],\n    [ entities | caption_entities ]: [ [ special entities ] ]\n  }\n]\n*/\n```\n\n##### From Variables\n\n###### Markdown\n```\nconst text = '*bold*\\n_italic_\\n' +\n    '[link](http://www.example.com/)\\n' +\n    '[mention](tg://user?id=1234567890)\\n' +\n    '`code`\\n```pre```\\n```markup\\nformatted```'\n\nconst result = mdv1.to_entities(text)\n/*\n[\n  {\n    [ text | caption ]: [ plain text ],\n    [ entities | caption_entities ]: [ [ special entities ] ]\n  }\n]\n*/\n```\n\n###### HTML\n```\nconst text = '\u003c b \u003ebold\u003c / b \u003e\\n' +\n    '\u003c strong \u003estrong\u003c / strong \u003e\\n' +\n    '\u003c i \u003eitalic\u003c / i \u003e\\n' +\n    '\u003c em \u003eemphasis\u003c / em \u003e\\n' +\n    '\u003c u \u003eunderline\u003c / u \u003e\\n' +\n    '\u003c ins \u003einserted\u003c / ins \u003e\\n' +\n    '\u003cb\u003ebold \u003ci\u003eitalic \u003cu\u003eunderline\u003c/u\u003e\u003c/i\u003e\u003c/b\u003e\\n' +\n    '\u003c s \u003estrikethrough\u003c / s \u003e\\n' +\n    '\u003c strike \u003estrike\u003c / strike \u003e\\n' +\n    '\u003c del \u003edeleted\u003c / del \u003e\\n' +\n    '\u003c span class = \"tg-spoiler\" \u003espoiler\u003c / span \u003e\\n' +\n    '\u003c tg-spoiler \u003etelegram spoiler\u003c / tg-spoiler \u003e\\n' +\n    '\u003c a href = \"http://www.example.com/\" \u003elink\u003c / a \u003e\\n' +\n    '\u003c a href = \"tg://user?id=1234567890\" \u003emention\u003c / a \u003e\\n' +\n    '\u003c tg-emoji emoji-id = \"5368324170671202286\" \u003e👍\u003c / tg-emoji \u003e\\n' +\n    '\u003c code \u003ecode\u003c /code \u003e\\n' +\n    '\u003c blockquote \u003eb\\nl\\no\\nc\\nk\u003c / blockquote \u003e\\n' +\n    '\u003c blockquote expandable \u003eq\\nu\\no\\nt\\ne\u003c / blockquote \u003e\\n' +\n    '\u003c pre \u003epre\u003c / pre \u003e\\n' +\n    '\u003c pre \u003e\u003c code class = \"language-markup\" \u003eformatted\u003c / code \u003e\u003c / pre \u003e'\n\nconst result = html.to_entities(text)\n/*\n[\n  {\n    [ text | caption ]: [ plain text ],\n    [ entities | caption_entities ]: [ [ special entities ] ]\n  }\n]\n*/\n```\n\n###### MarkdownV2\n```\nconst text = '*bold*\\n' +\n    '_italic_\\n' +\n    '__underline__\\n' +\n    '*bold _italic __underline___*\\n' +\n    '~strikethrough~\\n' +\n    '||spoiler||\\n' +\n    '[link](http://www.example.com/)\\n' +\n    '[mention](tg://user?id=1234567890)\\n' +\n    '![👍](tg://emoji?id=5368324170671202286)\\n' +\n    '`code`\\n' +\n    '\u003eb\\n\u003el\\n\u003eo\\n\u003ec\\n\u003ek\\n' +\n    '**\u003eq\\n\u003eu\\n\u003eo\\n\u003et\\n\u003ee||\\n' +\n    '```pre```\\n' +\n    '```markup\\nformatted```'\n\nconst result = md.to_entities(text)\n/*\n[\n  {\n    [ text | caption ]: [ plain text ],\n    [ entities | caption_entities ]: [ [ special entities ] ]\n  }\n]\n*/\n```\n\n##### With User Contents\nYou can use `.to_entities()` with stored user contents as well.\n```\n.to_entities(\n  string          text,\n  boolean|number  maxlen = false,\n  string|null     user_text = null,\n  array|null      user_text_entities = [ ]\n)\n```\n\n###### MarkdownV2\n```\nconst text = '*bold*\\n' +\n    '_italic_\\n' +\n    '__underline__\\n' +\n    '*bold _italic __underline___*\\n' +\n    '~strikethrough~\\n' +\n    '||spoiler||\\n' +\n    '[link](http://www.example.com/)\\n' +\n    '[mention](tg://user?id=1234567890)\\n' +\n    '![👍](tg://emoji?id=5368324170671202286)\\n' +\n    '`code`\\n' +\n    '\u003eb\\n\u003el\\n\u003eo\\n\u003ec\\n\u003ek\\n' +\n    '**\u003eq\\n\u003eu\\n\u003eo\\n\u003et\\n\u003ee||\\n' +\n    '```pre```\\n' +\n    '```markup\\nformatted```'\nconst userText = 'My name is Anatoly'\nconst userEntities = [ {\n  offset: 0,\n  length: 18,\n  type: 'bold'\n} ]\n\nconst result = md.to_entities(\n  text,\n  true, // or 4096\n  userText + ln(2),\n  userEntities\n)\n/*\n[\n  {\n    [ text | caption ]: [ plain text ],\n    [ entities | caption_entities ]: [ [ special entities ] ]\n  }\n]\n*/\n```\n\n### Forming Links\nYou can form links to Telegram users, bots, groups, channels, etc.\n```\nconst result = { text: telink.create({\n  // string\n  // username, telephone number, etc.\n  subject: 'mybot',\n  // number|string\n  // message ID, application name, etc.\n  element: 'myapp',\n  // string\n  // includes a start parameter entity: `?start=message`\n  entity: 'message',\n  // scalar\n  // includes a start parameter entity ID: `?start=message-8`\n  id: 8,\n  // object\n  // query parameters\n  params: {\n    mode: telink.parameters.mode.compact,\n    choose: Object.values(telink.parameters.choose)\n  },\n  // string\n  // username or telephone number of a specific user\n  // to open the attachment menu in the chat therewith\n  user: 'username',\n  // string|boolean\n  // starting operation\n  // true to delegate the selection\n  launch: true,\n  // string|boolean|null\n  // prompts to add the bot to the attachment menu\n  // null for links not related to applications\n  attach: true,\n  // boolean\n  // true to use the `t.me` syntax\n  short: true,\n  // boolean\n  // true to use the `tg` syntax\n  proto: false\n}) }\n// https://t.me/username/myapp\n// ?attach=mybot\u0026startattach=message-8\n// \u0026mode=compact\u0026choose=users+bots+groups+channels\n```\nYou can opt to use the `t.me` or `tg` syntax by default.\n```\n(telink.short = true) \u0026\u0026 (telink.proto = false)\n``` \n\n#### User Links\n```\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n  telink.user(1234567890),\n  // tg:user?id=1234567890\n  telink.user('+1234567890'),\n  // t.me/+1234567890\n  telink.user('username'),\n  // t.me/username\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n  telink.user(1234567890),\n  // tg://user?id=1234567890\n  telink.user('+1234567890'),\n  // tg://resolve?phone=1234567890\n  telink.user('username')\n  // tg://resolve?domain=username\n].join(ln()) }\n```\n\n#### Bot \u0026 App Links\n```\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n\n  telink.bot('mybot'),\n  // t.me/mybot\n  telink.bot('mybot', 'message', 8),\n  // t.me/mybot?start=message-8\n\n  telink.bot('mybot', null, null, true),\n  // t.me/mybot?startgroup\n  telink.bot('mybot', 'message', 8, true),\n  // t.me/mybot?startgroup=message-8\n  telink.bot('mybot', 'message', 8, true, [ 'delete_messages' ]),\n  // t.me/mybot?startgroup=message-8\u0026admin=delete_messages\n  telink.bot('mybot', true, [ 'post_messages' ]),\n  // t.me/mybot?startchannel\u0026admin=post_messages\n\n  telink.game('mybot', 'short_name'),\n  // t.me/mybot?game=short_name\n\n  telink.app('mybot'),\n  // t.me/mybot?startapp\n  telink.app('mybot', null, 'comment', 8),\n  // t.me/mybot?startapp=comment-8\n  telink.app('mybot', null, 'comment', 8, true),\n  // t.me/mybot?startapp=comment-8\u0026mode=compact\n\n  telink.app('mybot', 'myapp'),\n  // t.me/mybot/myapp\n  telink.app('mybot', 'myapp', 'comment', 8),\n  // t.me/mybot/myapp?startapp=comment-8\n  telink.app('mybot', 'myapp', 'comment', 8, true),\n  // t.me/mybot/myapp?startapp=comment-8\u0026mode=compact\n\n  telink.app('mybot', true),\n  // t.me/mybot?startattach\n  telink.app('mybot', true, 'comment', 8),\n  // t.me/mybot?startattach=comment-8\n\n  telink.app('mybot', null, null, null, false, 'username'),\n  // t.me/username?attach=mybot\n  telink.app('mybot', null, 'comment', 8, false, '+1234567890'),\n  // t.me/+1234567890?attach=mybot\u0026startattach=comment-8\n\n  telink.app('mybot', true, null, null, false, [ 'users', 'bots' ]),\n  // t.me/mybot?startattach\u0026choose=users+bots\n  telink.app('mybot', true, 'comment', 8, false, [ 'groups', 'channels' ]),\n  // t.me/mybot?startattach=comment-8\u0026choose=groups+channels\n\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n\n  telink.bot('mybot'),\n  // tg://resolve?domain=mybot\n  telink.bot('mybot', 'message', 8),\n  // tg://resolve?domain=mybot\u0026start=message-8\n\n  telink.bot('mybot', null, null, true),\n  // tg://resolve?domain=mybot\u0026startgroup\n  telink.bot('mybot', 'message', 8, true),\n  // tg://resolve?domain=mybot\u0026startgroup=message-8\n  telink.bot('mybot', 'message', 8, true, [ 'delete_messages' ]),\n  // tg://resolve?domain=mybot\u0026startgroup=message-8\u0026admin=delete_messages\n  telink.bot('mybot', true, [ 'post_messages' ]),\n  // tg://resolve?domain=mybot\u0026startchannel\u0026admin=post_messages\n\n  telink.game('mybot', 'short_name'),\n  // tg://resolve?domain=mybot\u0026game=short_name\n\n  telink.app('mybot'),\n  // tg://resolve?domain=mybot\u0026startapp\n  telink.app('mybot', null, 'comment', 8),\n  // tg://resolve?domain=mybot\u0026startapp=comment-8\n  telink.app('mybot', null, 'comment', 8, true),\n  // tg://resolve?domain=mybot\u0026startapp=comment-8\u0026mode=compact\n\n  telink.app('mybot', 'myapp'),\n  // tg://resolve?domain=mybot\u0026appname=myapp\n  telink.app('mybot', 'myapp', 'comment', 8),\n  // tg://resolve?domain=mybot\u0026appname=myapp\u0026startapp=comment-8\n  telink.app('mybot', 'myapp', 'comment', 8, true),\n  // tg://resolve?domain=mybot\u0026appname=myapp\u0026startapp=comment-8\u0026mode=compact\n\n  telink.app('mybot', true),\n  // tg://resolve?domain=mybot\u0026startattach\n  telink.app('mybot', true, 'comment', 8),\n  // tg://resolve?domain=mybot\u0026startattach=comment-8\n\n  telink.app('mybot', null, null, null, false, 'username'),\n  // tg://resolve?domain=username\u0026attach=mybot\n  telink.app('mybot', null, 'comment', 8, false, '+1234567890'),\n  // tg://resolve?phone=1234567890\u0026attach=mybot\u0026startattach=comment-8\n\n  telink.app('mybot', true, null, null, false, [ 'users', 'bots' ]),\n  // tg://resolve?domain=mybot\u0026startattach\u0026choose=users+bots\n  telink.app('mybot', true, 'comment', 8, false, [ 'groups', 'channels' ])\n  // tg://resolve?domain=mybot\u0026startattach=comment-8\u0026choose=groups+channels\n].join(ln()) }\n```\n\n#### Group \u0026 Channel Links\n```\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n  telink.group('mygroup'),\n  // t.me/mygroup\n  telink.channel('mychannel'),\n  // t.me/mychannel\n  telink.invite('hash'),\n  // t.me/+hash\n  telink.invite('hash', false),\n  // t.me/joinchat/hash\n  telink.folder('slug'),\n  // t.me/addlist/slug\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n  telink.group('mygroup'),\n  // tg://resolve?domain=mygroup\n  telink.channel('mychannel'),\n  // tg://resolve?domain=mychannel\n  telink.invite('hash'),\n  // tg://join?invite=hash\n  telink.folder('slug')\n  // tg://addlist?slug=slug\n].join(ln()) }\n```\n\n#### Message Links\n```\nconst tid = 1 // thread ID\nconst mid = 2 // message ID\nconst cid = 3 // comment ID\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n  telink.forum(12345, null, tid),\n  // t.me/c/12345?thread=1\n  telink.forum('mygroup', mid, tid),\n  // t.me/mygroup/1/2\n  telink.message(67890, mid, cid, tid, true),\n  // t.me/c/67890/1/2?single\u0026comment=3\n  telink.message('mychannel', mid, cid, tid, false, 3723, 'h'),\n  // t.me/mychannel/1/2?comment=3\u0026t=1h02m03s\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n  telink.forum(12345, null, tid),\n  // tg://privatepost?channel=12345\u0026thread=1\n  telink.forum('mygroup', mid, tid),\n  // tg://resolve?domain=mygroup\u0026post=2\u0026thread=1\n  telink.message(67890, mid, cid, tid, true),\n  // tg://privatepost?channel=67890\u0026post=2\u0026single\u0026thread=1\u0026comment=3\n  telink.message('mychannel', mid, cid, tid, false, '1h02m03s', 'm')\n  // tg://resolve?domain=mychannel\u0026post=2\u0026thread=1\u0026comment=3\u0026t=62:03\n].join(ln()) }\n```\n\n#### Video/Voice Chats \u0026 Livestream Links\n```\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n  telink.videochat('mygroup'),\n  // t.me/mygroup?videochat\n  telink.videochat('mygroup', 'invite_hash'),\n  // t.me/mygroup?videochat=invite_hash\n  telink.voicechat('mygroup'),\n  // t.me/mygroup?voicechat\n  telink.voicechat('mygroup', 'invite_hash'),\n  // t.me/mygroup?voicechat=invite_hash\n  telink.livestream('mychannel'),\n  // t.me/mychannel?livestream\n  telink.livestream('mychannel', 'invite_hash'),\n  // t.me/mychannel?livestream=invite_hash\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n  telink.videochat('mygroup'),\n  // tg://resolve?domain=mygroup\u0026videochat\n  telink.videochat('mygroup', 'invite_hash'),\n  // tg://resolve?domain=mygroup\u0026videochat=invite_hash\n  telink.voicechat('mygroup'),\n  // tg://resolve?domain=mygroup\u0026voicechat\n  telink.voicechat('mygroup', 'invite_hash'),\n  // tg://resolve?domain=mygroup\u0026voicechat=invite_hash\n  telink.livestream('mychannel'),\n  // tg://resolve?domain=mychannel\u0026livestream\n  telink.livestream('mychannel', 'invite_hash')\n  // tg://resolve?domain=mychannel\u0026livestream=invite_hash\n].join(ln()) }\n```\n\n#### Share Links\n```\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n  telink.share('www.example.com'),\n  // t.me/share?url=www.example.com\n  telink.share('www.example.com', 'Example'),\n  // t.me/share?url=www.example.com\u0026text=Example\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n  telink.share('www.example.com'),\n  // tg://msg_url?url=www.example.com\n  telink.share('www.example.com', 'Example')\n  // tg://msg_url?url=www.example.com\u0026text=Example\n].join(ln()) }\n```\n\n#### Boost Links\n```\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n  telink.boost(12345),\n  // t.me/c/12345?boost\n  telink.boost(67890, false),\n  // t.me/boost?c=67890\n  telink.boost('newchannel'),\n  // t.me/boost/newchannel\n  telink.boost('oldchannel', false),\n  // t.me/oldchannel?boost\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n  telink.boost(88888),\n  // tg://boost?channel=88888\n  telink.boost('anychannel')\n  // tg://boost?domain=anychannel\n].join(ln()) }\n```\n\n#### Story Links\n```\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n  telink.story('username', 'story_id'),\n  // t.me/username/s/story_id\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n  telink.story('username', 'story_id')\n  // tg://resolve?domain=username\u0026story=story_id\n].join(ln()) }\n```\n\n#### Emojis \u0026 Stickers Links\n```\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n  telink.emojis('slug'),\n  // t.me/addemoji/slug\n  telink.stickers('slug'),\n  // t.me/addstickers/slug\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n  telink.emoji('5368324170671202286'),\n  // tg://emoji?id=5368324170671202286\n  telink.emojis('slug'),\n  // tg://addemoji?set=slug\n  telink.stickers('slug')\n  // tg://addstickers?set=slug\n].join(ln()) }\n```\n\n#### Premium Links\n```\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n  telink.premium('giftcode'),\n  // t.me/giftcode\n  telink.premium(1, 'slug'),\n  // t.me/giftcode/slug\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n  telink.premium('giftcode'),\n  // tg://giftcode\n  telink.premium(1, 'slug'),\n  // tg://giftcode?slug=slug\n  telink.premium('offer'),\n  // tg://premium_offer\n  telink.premium(2, 'referrer'),\n  // tg://premium_offer?ref=referrer\n  telink.premium('multigift'),\n  // tg://premium_multigift\n  telink.premium(3, 'referrer')\n  // tg://premium_multigift?ref=referrer\n].join(ln()) }\n```\n\n#### Invoice Links\n```\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n  telink.invoice('slug'),\n  // t.me/$slug\n  telink.invoice('slug', false),\n  // t.me/invoice/slug\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n  telink.invoice('slug')\n  // tg://invoice?slug=slug\n].join(ln()) }\n```\n\n#### Language Links\n```\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n  telink.language('slug'),\n  // t.me/setlanguage/slug\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n  telink.language('slug')\n  // tg://setlanguage?lang=slug\n].join(ln()) }\n```\n\n#### Theme Links\n```\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n  telink.theme('name'),\n  // t.me/addtheme/name\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n  telink.theme('name')\n  // tg://addtheme?slug=name\n].join(ln()) }\n```\n\n#### Wallpaper Links\n```\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n\n  telink.bg('slug', false, false),\n  // t.me/bg/slug\n  telink.bg('slug', true, true),\n  // t.me/bg/slug?mode=blur+motion\n\n  telink.bg('DC143C'),\n  // t.me/bg/DC143C\n  telink.bg('FF0000', 'FFC0CB'),\n  // t.me/bg/FF0000-FFC0CB\n  telink.bg('FF7F50', 'FFA500', 90),\n  // t.me/bg/FF7F50-FFA500?rotation=90\n\n  telink.bg('FFD700', 'FFFF00', 'FFE4B5'),\n  // t.me/bg/FFD700~FFFF00~FFE4B5\n  telink.bg('F0E68C', 'E6E6FA', 'EE82EE', 'DA70D6'),\n  // t.me/bg/F0E68C~E6E6FA~EE82EE~DA70D6\n\n  telink.bg('slug', 'FF00FF', 10),\n  // t.me/bg/slug?bg_color=FF00FF\u0026intensity=10\n  telink.bg('slug', '800080', 20, true),\n  // t.me/bg/slug?bg_color=800080\u0026intensity=20\u0026mode=motion\n\n  telink.bg('slug', '4B0082', '00FF00', 30),\n  // t.me/bg/slug?bg_color=4B0082-00FF00\u0026intensity=30\n  telink.bg('slug', '008000', '008080', 40, 180),\n  // t.me/bg/slug?bg_color=008000-008080\u0026intensity=40\u0026rotation=180\n  telink.bg('slug', '00FFFF', '7FFFD4', 50, 270, true),\n  // t.me/bg/slug?bg_color=00FFFF-7FFFD4\u0026intensity=50\u0026rotation=270\u0026mode=motion\n\n  telink.bg('slug', '40E0D0', '0000FF', '000080', 60),\n  // t.me/bg/slug?bg_color=40E0D0~0000FF~000080\u0026intensity=60\n  telink.bg('slug', 'D2691E', 'A52A2A', '800000', 70, true),\n  // t.me/bg/slug?bg_color=D2691E~A52A2A~800000\u0026intensity=70\u0026mode=motion\n  telink.bg('slug', 'FFFFFF', 'F0FFFF', 'F5F5DC', 'FFFFF0', 80),\n  // t.me/bg/slug?bg_color=FFFFFF~F0FFFF~F5F5DC~FFFFF0\u0026intensity=80\n  telink.bg('slug', 'FAF0E6', 'C0C0C0', '808080', '000000', 90, true),\n  // t.me/bg/slug?bg_color=FAF0E6~C0C0C0~808080~000000\u0026intensity=90\u0026mode=motion\n\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n\n  telink.bg('slug', false, false),\n  // tg://bg?slug=slug\n  telink.bg('slug', true, true),\n  // tg://bg?slug=slug\u0026mode=blur+motion\n\n  telink.bg('DC143C'),\n  // tg://bg?color=DC143C\n  telink.bg('FF0000', 'FFC0CB'),\n  // tg://bg?gradient=FF0000-FFC0CB\n  telink.bg('FF7F50', 'FFA500', 90),\n  // tg://bg?gradient=FF7F50-FFA500\u0026rotation=90\n\n  telink.bg('FFD700', 'FFFF00', 'FFE4B5'),\n  // tg://bg?gradient=FFD700~FFFF00~FFE4B5\n  telink.bg('F0E68C', 'E6E6FA', 'EE82EE', 'DA70D6'),\n  // tg://bg?gradient=F0E68C~E6E6FA~EE82EE~DA70D6\n\n  telink.bg('slug', 'FF00FF', 10),\n  // tg://bg?slug=slug\u0026bg_color=FF00FF\u0026intensity=10\n  telink.bg('slug', '800080', 20, true),\n  // tg://bg?slug=slug\u0026bg_color=800080\u0026intensity=20\u0026mode=motion\n\n  telink.bg('slug', '4B0082', '00FF00', 30),\n  // tg://bg?slug=slug\u0026bg_color=4B0082-00FF00\u0026intensity=30\n  telink.bg('slug', '008000', '008080', 40, 180),\n  // tg://bg?slug=slug\u0026bg_color=008000-008080\u0026intensity=40\u0026rotation=180\n  telink.bg('slug', '00FFFF', '7FFFD4', 50, 270, true),\n  // tg://bg?slug=slug\u0026bg_color=00FFFF-7FFFD4\u0026intensity=50\u0026rotation=270\u0026mode=motion\n\n  telink.bg('slug', '40E0D0', '0000FF', '000080', 60),\n  // tg://bg?slug=slug\u0026bg_color=40E0D0~0000FF~000080\u0026intensity=60\n  telink.bg('slug', 'D2691E', 'A52A2A', '800000', 70, true),\n  // tg://bg?slug=slug\u0026bg_color=D2691E~A52A2A~800000\u0026intensity=70\u0026mode=motion\n  telink.bg('slug', 'FFFFFF', 'F0FFFF', 'F5F5DC', 'FFFFF0', 80),\n  // tg://bg?slug=slug\u0026bg_color=FFFFFF~F0FFFF~F5F5DC~FFFFF0\u0026intensity=80\n  telink.bg('slug', 'FAF0E6', 'C0C0C0', '808080', '000000', 90, true)\n  // tg://bg?slug=slug\u0026bg_color=FAF0E6~C0C0C0~808080~000000\u0026intensity=90\u0026mode=motion\n].join(ln()) }\n```\n\n#### Proxy Links\n```\nconst result = { text: [\n  telink.proxy('www.example.com', 443, 'secret'),\n  // https://telegram.me/proxy\n  // ?server=www.example.com\u0026port=443\u0026secret=secret\n  telink.socks5('www.example.com', 443, 'username', 'password')\n  // https://telegram.me/socks\n  // ?server=www.example.com\u0026port=443\u0026user=username\u0026pass=password\n].join(ln()) }\n```\n\n#### Settings Links\n```\nconst result = { text: [\n  telink.settings(),\n  // tg://settings\n  telink.change_number(),\n  // tg://settings/change_number\n  telink.devices(),\n  // tg://settings/devices\n  telink.folders(),\n  // tg://settings/folders\n  telink.languages(),\n  // tg://settings/language\n  telink.privacy(),\n  // tg://settings/privacy\n  telink.auto_delete(),\n  // tg://settings/auto_delete\n  telink.edit_profile(),\n  // tg://settings/edit_profile\n  telink.themes()\n  // tg://settings/themes\n].join(ln()) }\n```\n\n#### Passport Links\n```\nconst result = { text: [\n  telink.passport({\n    bot_id: 9876543210,\n    scope: { d: [ { _: 'pd' } ], v: 1 },\n    public_key: 'bot_public_key',\n    nonce: 'nonce',\n    callback_url: 'https://www.example.com/callback/'\n  })\n].join(ln()) }\n// tg://passport\n// ?bot_id=9876543210\n// \u0026scope=%7B%22d%22%3A%5B%7B%22_%22%3A%22pd%22%7D%5D%2C%22v%22%3A1%7D\n// \u0026public_key=bot_public_key\n// \u0026nonce=nonce\n// \u0026callback_url=https%3A%2F%2Fwww.example.com%2Fcallback%2F\n```\n\n#### Other Links\n```\nconst result = { text: [\n  (telink.https = null) ||\n  (telink.short = true),\n  // true\n  telink.contact('token'),\n  // t.me/contact/token\n  telink.login('code'),\n  // t.me/login/code\n  telink.login(null, 'base64encodedtoken'),\n  // tg://login?token=base64encodedtoken\n  telink.confirm_phone('+1234567890', 'hash'),\n  // t.me/confirmphone?phone=1234567890\u0026hash=hash\n  (telink.short = false) ||\n  (telink.proto = true),\n  // true\n  telink.contact('token'),\n  // tg://contact?token=token\n  telink.login('code'),\n  // tg://login?code=code\n  telink.login(null, 'base64encodedtoken'),\n  // tg://login?token=base64encodedtoken\n  telink.confirm_phone('+1234567890', 'hash')\n  // tg://confirmphone?phone=1234567890\u0026hash=hash\n].join(ln()) }\n```\n\n### Using Unicode\nYou can also use a few Unicode symbols with the `symbol` function.\n```\nfor (const code of [\n  '0',    // 🯰\n  '1',    // 🯱\n  '2',    // 🯲\n  '3',    // 🯳\n  '4',    // 🯴\n  '5',    // 🯵\n  '6',    // 🯶\n  '7',    // 🯷\n  '8',    // 🯸\n  '9',    // 🯹\n  '8-',   // ∞ (infinity)\n  '+',    // + (plus)\n  '-',    // − (minus)\n  '+-',   // ± (plus‐minus)\n  '*',    // × (multiplication)\n  '/',    // ÷ (division)\n  '=',    // =\n  '~~',   // ≈\n  '\u003e=',   // ≥\n  '\u003c=',   // ≤\n  '!=',   // ≠\n  '.',    // · (middle dot)\n  'o',    // ° (degree)\n  'O',    // • (bullet)\n  '\u003e_',   // 🮥\n  '\u003c',    // ‹\n  '\u003e',    // ›\n  '\u003c\u003c',   // «\n  '\u003e\u003e',   // »\n  'h',    // ‐ (hyphen)\n  'H',    // ‑ (non‐breaking hyphen)\n  '--',   // – (en dash)\n  '---',  // — (em dash)\n  '...'   // … (horizontal ellipsis)\n]) console.log(`${code} =\u003e ${symbol(code)}`)\n```\n\n## Contributing\nContributions are only allowed in TON:\n```\nUQCYqT9-ycmXE3o57Cac1sM5ntIKdjqIwP3kzWmiZik0VU_b\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faeurum%2Fteleform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faeurum%2Fteleform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faeurum%2Fteleform/lists"}