{"id":50277856,"url":"https://github.com/passimx/archiver","last_synced_at":"2026-05-27T22:02:11.199Z","repository":{"id":346514933,"uuid":"1190183551","full_name":"Passimx/archiver","owner":"Passimx","description":"Npm package for archive telegram chat messages","archived":false,"fork":false,"pushed_at":"2026-03-24T07:25:36.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-25T08:52:56.409Z","etag":null,"topics":["analytics","chats","export","keep","logs","save","telegraf","telegram"],"latest_commit_sha":null,"homepage":"https://t.me/keep_chats_bot","language":"TypeScript","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/Passimx.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-24T03:24:39.000Z","updated_at":"2026-03-24T07:25:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Passimx/archiver","commit_stats":null,"previous_names":["passimx/archiver"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Passimx/archiver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Passimx%2Farchiver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Passimx%2Farchiver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Passimx%2Farchiver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Passimx%2Farchiver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Passimx","download_url":"https://codeload.github.com/Passimx/archiver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Passimx%2Farchiver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33585203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["analytics","chats","export","keep","logs","save","telegraf","telegram"],"created_at":"2026-05-27T22:02:09.822Z","updated_at":"2026-05-27T22:02:11.184Z","avatar_url":"https://github.com/Passimx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @passimx/archiver\n\nSimple SDK for archiving Telegram bot events and chats using Telegraf.\n\n## Installation\n\n```bash\nnpm install @passimx/archiver\n```\n\n## Requirements\n\n* Node.js \u003e= 18 (uses native `fetch`)\n* `telegraf` \u003e= 4\n\n## Getting API Key\nYou can obtain an API key via Telegram bot:\n\n[@keep_chats_bot](https://t.me/keep_chats_bot)\n\nSend command:\n```text\n/verify \u003cyour_bot_token\u003e\n```\nAfter verification you will receive your **API key**.\n\n### ⚠️ Security recommendation\n\nAfter connecting, it is strongly recommended to revoke your Telegram bot token via [@BotFather](https://t.me/BotFather):\n\n```text\n👉 /revoke (в @BotFather)\n```\n\nThis will invalidate the old token and protect your bot.\n\n## Usage\n\n```ts\nimport { Telegraf } from 'telegraf';\nimport { Archiver } from '@passimx/archiver';\n\nconst bot = new Telegraf(process.env.BOT_TOKEN!);\n\nconst archiver = new Archiver({\n  apiKey: 'YOUR_API_KEY',\n  // endpoint is optional\n});\n\n// Start listening and sending events\narchiver.listen(bot);\n\nbot.start((ctx) =\u003e ctx.reply('Hello'));\nbot.launch();\n```\n\n## Export chat\n\n```ts\nconst chat = await archiver.exportChat(123456);\n\nconsole.log(chat);\n```\n\n\n## What it does\n\n* Forwards all incoming Telegram updates to your API\n* Intercepts outgoing Telegram API calls (send*, edit*) by patching Telegraf internals\n* Sends all events to your backend for storage or processing\n* Provides chat export via API\n\n\n## API\n\n### `new Archiver(options)`\n\n| Option   | Type   | Description             |\n| -------- | ------ |-------------------------|\n| apiKey   | string | Authorization key       |\n| endpoint | string | API base URL (optional) |\n\nIf endpoint is not provided, a default value will be used.\n\n---\n\n### `archiver.listen(bot)`\n\nStarts tracking:\n\n* incoming updates\n* outgoing messages\n\n---\n\n### `archiver.exportChat(id)`\n\nFetches chat data from API.\n\nReturns:\n\n```ts\nPromise\u003cChatInterface | null\u003e\n```\n\n## Notes\n\n* This library patches Telegraf internally\n* Errors are logged to console\n* Make sure your API is available and accepts requests\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassimx%2Farchiver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpassimx%2Farchiver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpassimx%2Farchiver/lists"}