{"id":15017605,"url":"https://github.com/ejnshtein/vk-to-telegram","last_synced_at":"2025-04-12T12:33:27.957Z","repository":{"id":29919739,"uuid":"123030645","full_name":"ejnshtein/vk-to-telegram","owner":"ejnshtein","description":"Utility to forward posts from VK through callback API to telegram channel or chat","archived":false,"fork":false,"pushed_at":"2023-03-04T02:48:57.000Z","size":364,"stargazers_count":37,"open_issues_count":5,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T07:11:20.049Z","etag":null,"topics":["api","bot","callback","express","telegraf","telegram","vk","vkontakte"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vk-to-telegram","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/ejnshtein.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}},"created_at":"2018-02-26T21:07:40.000Z","updated_at":"2024-06-16T08:42:23.000Z","dependencies_parsed_at":"2023-01-14T15:54:55.149Z","dependency_job_id":null,"html_url":"https://github.com/ejnshtein/vk-to-telegram","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejnshtein%2Fvk-to-telegram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejnshtein%2Fvk-to-telegram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejnshtein%2Fvk-to-telegram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejnshtein%2Fvk-to-telegram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ejnshtein","download_url":"https://codeload.github.com/ejnshtein/vk-to-telegram/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248566590,"owners_count":21125693,"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":["api","bot","callback","express","telegraf","telegram","vk","vkontakte"],"created_at":"2024-09-24T19:50:44.436Z","updated_at":"2025-04-12T12:33:27.918Z","avatar_url":"https://github.com/ejnshtein.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vk to telegram forwarder\n\n[![NPM Version](https://img.shields.io/npm/v/vk-to-telegram.svg?style=flat-square)](https://www.npmjs.com/package/vk-to-telegram)\n[![node](https://img.shields.io/node/v/vk-to-telegram.svg?style=flat-square)](https://www.npmjs.com/package/vk-to-telegram)\n\n## Installation\n\n    npm i vk-to-telegram --save\n\n### Example\n\n```js\nconst app = require('express')()\nconst bodyParser = require('body-parser')\nconst vkToTelegram = require('vk-to-telegram')\nconst vkToTg = new vkToTelegram({\n  botToken: 'your bot token',\n  chatName: 'telegram chat/channel name',\n  ownerId: 'your telegram id', // number\n  vkToken: 'your very long token from vk api',\n  vkConfirmation: 'group confirmation'\n})\napp.use(bodyParser.json())\napp.post('/', (req, res) =\u003e {\n  vkToTg.send(req, res)\n    .then(() =\u003e console.log('Done!'))\n    .catch((err) =\u003e {\n      console.log('Something went wrong')\n      console.log(err)\n    })\n})\n\napp.listen(80, ()=\u003e{\n  console.log('listening on port 80')\n})\n```\n\n## What is this\n\nIt is a tool for express which using [VK callback api](https://vk.com/dev/callback_api) forwards posts from group in channel or chat in Telegram!  \n\n## async/await\n\nHere's example with koa2\n\n```js\napp.use(bodyParser())\napp.use(async ctx =\u003e {\n  const result = await vkToTg.send(ctx)\n  console.log(result)\n})\n```\n\n## Used by:\n\n| [\u003cimg src=\"https://i.imgur.com/UYV2cfV.png\" height=\"120\"\u003e](https://vk.com/advance_empire) | [\u003cimg src=\"https://i.imgur.com/2RR0fXh.png\" height=\"120\"\u003e](https://vk.com/panzer_sofa) | [\u003cimg src=\"https://i.imgur.com/51DrStx.jpg\" height=\"120\"\u003e](https://vk.com/oleglivanovgaming) | [\u003cimg src=\"https://i.imgur.com/FnBpfyl.jpg\" height=\"120\"\u003e](https://vk.com/ongoing_research) |  \n|-|-|-|-|\n| [AlexandriA (AAR)](https://t.me/advance_emp) | [PanzerSofa](https://t.me/PanzerSofa) | [Олег Ливанов](https://t.me/oleglivanovgaming) | [ongoing research](https://t.me/ongoings) |\n| [\u003cimg src=\"https://i.imgur.com/7wydIxN.png\"  height=\"120\"\u003e](https://vk.com/anireact) | [\u003cimg src=\"https://i.imgur.com/Y0kda79.png\"  height=\"120\"\u003e](https://vk.com/otakusquad) | [\u003cimg src=\"https://i.imgur.com/yu6BNFj.png\"  height=\"120\"\u003e](https://vk.com/dsgtng) |[\u003cimg src=\"https://i.imgur.com/IBKqHUj.jpg\"  height=\"120\"\u003e](https://vk.com/fondspeedwagona)|\n| [аниреакт](https://t.me/telereact) | [Otaku Squad](https://t.me/otakusquadt) | [disgusting otaku](https://t.me/dsgstngotakunews) | [Fond SpeedWagona](https://t.me/jojomemesss)|\n\n## What content does it forward\n\n| Content type | Works fully? |  \n| - | - |  \n| Photo(s) | `Yes` |\n| Video(s) | `Yes` |  \n| Document(s) | `Yes` |\n| Link | `Yes` |  \n| Application Content | `Yes` |\n| Poll | `Yes` |\n| Audio(s) | **NO.** Why? [Read here](https://vk.com/dev/audio). |\n| Album(s) | `Yes` |\n| Graffiti | `Not tested.` |\n| Wiki Page | `Not tested.` |\n| Market item | `Not tested.` |\n| Sticker | `Not tested.` |\n\n## Free usage\n\nIf you want to test this code, or use on a regular basis (via heroku), please [contact](#contact) me for setup.\n\n## Variables\n\n|Variable|Type|Required|Description|\n|-|-|-|-|\n| `token`|`String`|**Yes**|Bot token from [Botfather](https://t.me/botfather)|\n| `chatName`|`String` | **Yes**  | Telegram channel or group link, like '[@tavernofheroes](https://t.me/tavernofoverwatchnews)'|\n| `ownerId`|`Number`|**Yes** | Your telegram id for sending error if they are. U can get know it from [@getidsbot](https://t.me/getidsbot)|\n| `vkConfirmation`|`String`|**Yes**|Confirmation string from ur group callback api server: \u003cimg src=\"https://i.imgur.com/Gq1bly4.png\" width=\"600\"\u003e|\n| `vkToken` |`String`| **Yes** | Follow the instructions below:|\n||||1. Create Standalone application here: [https://vk.com/apps?act=manage](https://vk.com/apps?act=manage) |\n||||2. Open settings in created application and copy application id |\n||||3. Open this link with replace your application id: |\n||||https://oauth.vk.com/authorize?client_id=YOUR APPLICATION ID\u0026display=page\u0026redirect_uri=http://vk.com/\u0026scope=offline,video,docs\u0026response_type=token\u0026v=5.81|\n||||4. Click allow all that need's and it's all! Your token is in query url, do not copy all link, only token without other params.  |\n|`chatId`|`Number`|**Optional**|If you know your chat/channel id, put it here, it will replace `chatName` parameter|\n|`fromId` |`Number`| **Optional** | VK group id with '-'in start or nothing, if you don't need check. |\n|`customVkButton`|`String`|**Optional**|Title for button which will be added to each post to open it in VK|\n|`customPollTitle`|`String`|**Optional**|Custom template string in the title of button with URL to poll(\"Open poll\" -\u003e \"Open poll - ${poll.question}\")|\n|`customLongPostText`|`String`|**Optional**|Custom template string that replace full post text, because it's too long for Telegram(max 4096 characters) (\"Too long post... [Read full]\" -\u003e \"Too long post... \\\u003ca href=\"https://vk.com/poll${poll.owner_id}_${poll.id}\"\u003eRead full\u003c/a\u003e\" and parse as HTML)|\n|`signed`|`String`|**Optional**|Custom template string that add post signer in the end of Telegram message (\"Post By\" -\u003e \"\\n\\nPost by \\\u003ca href=\"https://vk.com/id${post.signer_id}\"\u003e${signer.first_name} ${signer.last_name}\u003c/a\u003e\" and parse as HTML) |\n|`heroku`|`Boolean`|**Optional**|Add filter that stops forwarder if detect that post repeats(Because of app [sleeping](https://devcenter.heroku.com/articles/free-dyno-hours))|\n|`herokuTimeout`|`Number`|**Optional**|Heroku post delay between same posts|\n|`secret`|`String`|**Optional**|Secret field from vk admin panel to verify that post has come from VK|\n|`filterByWord`|`String`|**Optional**|Filter posts by key word(s) (use ',' as separator) (use '-' in begin of word to invert)|\n|`filterByHashtag`|`String`|**Optional**|Filter posts by hashtag (use ',' as separator) (use '-' in begin of word to invert)|\n|`ads`|`Boolean`|**Optional**|Forward posts marked as ads? (By default `true`)|\n|`repostAds`|`Boolean`|**Optional**|Forward reposts marked as ads? (By default `true`)|\n|`appendText`|`String`|**Optional**|Append text to forwarded post (can be used for hashtags for channel navigation)|\n|`prependText`|`String`|**Optional**|Same as `appendText` but it's will prepend it in the start of post text|\n|`repost`|`Boolean`|**Optional**|Allow to forward post with repost (By default `true`)|  \n|`sendNativePoll`|`Boolean`|**Optional**|Use native [Telegram poll](https://core.telegram.org/bots/api#april-14-2019) instead of link to poll in VK, set `false` to use poll in VK|\n|`criedHalfBea`|`Boolean`|**Optional**|Use Z sized pictures as max. (Reduces pictures aliasing)|\n\n* DON'T forget to pick in your vk group api dashboard event type 'WALL POST - NEW'.\n* Recommend to use vk api **v5.103**\n\n## Contact\n\n[Telegram group](https://t.me/vktotgforwarder), [Telegram](https://t.me/ejnshtein), [Mail](mailto:ejnshtein@dsgstng.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejnshtein%2Fvk-to-telegram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fejnshtein%2Fvk-to-telegram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejnshtein%2Fvk-to-telegram/lists"}