{"id":25692037,"url":"https://github.com/artginzburg/telegraf-layoutfixer","last_synced_at":"2026-06-13T03:33:31.824Z","repository":{"id":40701493,"uuid":"394063265","full_name":"artginzburg/telegraf-layoutfixer","owner":"artginzburg","description":":airplane: Layout fixing middleware for Telegram bots","archived":false,"fork":false,"pushed_at":"2022-06-26T02:20:15.000Z","size":69,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-17T21:13:33.601Z","etag":null,"topics":["middleware","telegram"],"latest_commit_sha":null,"homepage":"https://npm.im/telegraf-layoutfixer","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artginzburg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-08T20:23:46.000Z","updated_at":"2021-10-05T15:00:54.000Z","dependencies_parsed_at":"2022-08-29T07:50:12.887Z","dependency_job_id":null,"html_url":"https://github.com/artginzburg/telegraf-layoutfixer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artginzburg%2Ftelegraf-layoutfixer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artginzburg%2Ftelegraf-layoutfixer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artginzburg%2Ftelegraf-layoutfixer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artginzburg%2Ftelegraf-layoutfixer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artginzburg","download_url":"https://codeload.github.com/artginzburg/telegraf-layoutfixer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240571007,"owners_count":19822412,"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":["middleware","telegram"],"created_at":"2025-02-24T23:08:01.724Z","updated_at":"2026-06-13T03:33:26.801Z","avatar_url":"https://github.com/artginzburg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n\n  [telegraf][telegraf]-layoutfixer\n\u003c/h1\u003e\n\n[![Dependencies](https://status.david-dm.org/gh/artginzburg/telegraf-layoutfixer.svg)](https://david-dm.org/artginzburg/telegraf-layoutfixer)\n\u003ca href=\"https://www.npmjs.com/package/telegraf-layoutfixer?activeTab=versions\"\u003e\u003cimg align=\"right\" alt=\"npm\" src=\"https://img.shields.io/npm/dw/telegraf-layoutfixer?labelColor=white\u0026color=cd0d0d\u0026logo=npm\"\u003e\u003c/a\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n  Suggests layout typo fixes in Telegram chats (`.рудз` =\u003e `/help`)\n\u003c/div\u003e\n\n## Quick start\n\nFirst, run `npm i telegraf-layoutfixer`. Then, in your [Telegraf][telegraf] app:\n\n```js\nconst { Telegraf } = require('telegraf')\nconst layoutfixer = require('telegraf-layoutfixer')\n\nconst bot = new Telegraf(process.env.BOT_TOKEN)\n\n// ...\n\nbot.use(layoutfixer())\n\nbot.launch()\n```\n\n\u003e layoutfixer should be connected last, after all the other text-related middlewares\n\n## Preview\n\n\u003cimg width=\"300\" alt=\"preview\" src=\"misc/preview.jpg\"\u003e\n\n## Options\n\n[Defaults](https://github.com/artginzburg/telegraf-layoutfixer/blob/main/defaultConfig.js) are shown below:\n\n```js\nrequire('telegraf-layoutfixer')({\n  allowUnlistedCommands: false,\n  validator: /^\\w+$/,\n  validInitiators: ['/', '.', '?', '÷', '\\\\', '|', '«', '»'],\n  commands: undefined,\n});\n```\n\n### allowUnlistedCommands (_default: `false`_)\n\nSets whether the bot should suggest fixes for commands that are not shown when the user starts typing `/`\n\n### validator (_default: `/^\\w+$/`_)\n\nSets a RegEx for validating layout-converted message as a command. Allows only words by default (a-z, A-Z, 0-9, _)\n\n### validInitiators (_default: `['/', '.', '?', '÷', '\\\\', '|', '«', '»']`_)\n\nDefines the first symbol of a message that tells layoutfixer the text should be interpreted as a command.\n\n### commands (_default: `ctx.telegram.getMyCommands()`_)\n\nSets the commands that count as listed (if `allowUnlistedCommands` is `false`). Gets the bot's currently specified commands by default.\n\n## Caught a Bug?\n\n1. [Fork](https://help.github.com/articles/fork-a-repo/) this [repository](https://github.com/artginzburg/telegraf-layoutfixer/fork) to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device\n2. Link the package to the global module directory: `npm link`\n3. Within the Telegraf app you want to test your local development instance of telegraf-layoutfixer, just link it to the dependencies: `npm link telegraf-layoutfixer`. Instead of the default one from npm, Node.js will now use your clone of the middleware!\n\n[telegraf]: https://www.npmjs.com/package/telegraf\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartginzburg%2Ftelegraf-layoutfixer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartginzburg%2Ftelegraf-layoutfixer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartginzburg%2Ftelegraf-layoutfixer/lists"}