{"_id":"@bozonx/social-posting-telegram","_rev":"5-c933e6b338352014b299499d22b25d5c","name":"@bozonx/social-posting-telegram","dist-tags":{"latest":"0.8.0"},"versions":{"0.3.0":{"name":"@bozonx/social-posting-telegram","version":"0.3.0","keywords":["social-media","posting","telegram"],"author":"Ivan K","license":"MIT","_id":"@bozonx/social-posting-telegram@0.3.0","maintainers":[{"name":"bozonx","email":"ipkozyrin@gmail.com"}],"homepage":"https://github.com/bozonx/social-media-posting/tree/main/packages/platform-telegram#readme","bugs":{"url":"https://github.com/bozonx/social-media-posting/issues"},"dist":{"shasum":"539f77751273ff1b138d8999138b2825059c3de5","tarball":"https://registry.npmjs.org/@bozonx/social-posting-telegram/-/social-posting-telegram-0.3.0.tgz","fileCount":27,"integrity":"sha512-9IdmQ8isLhy/XTYP8qZDPUHaKhew5NBGmsPkrVaNv4cQz1NZvpfSw/eMsXdlg8L8WOB9YZWKoTVM1odwa1wHtA==","signatures":[{"sig":"MEYCIQDQ8ZscBeDdXKu3ZLWnNSsrGjOW7sTJorN/YldST9KG9QIhAIazp79ANVVBm3fbHX5HowwhKRJj9ffGMZRn8xdnITIw","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":75668},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=24.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","workerd":"./dist/index.js"}},"scripts":{"test":"pnpm -w exec vitest run --project platforms","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"bozonx","email":"ipkozyrin@gmail.com"},"repository":{"url":"git+https://github.com/bozonx/social-media-posting.git","type":"git","directory":"packages/platform-telegram"},"description":"Telegram platform for @bozonx/social-posting","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","dependencies":{},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@bozonx/social-posting":"0.3.0","@bozonx/social-posting-conformance":"0.3.0"},"peerDependencies":{"@bozonx/social-posting":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/social-posting-telegram_0.3.0_1787230956674_0.9278169922958881","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@bozonx/social-posting-telegram","version":"0.4.0","keywords":["social-media","posting","telegram"],"author":"Ivan K","license":"MIT","_id":"@bozonx/social-posting-telegram@0.4.0","maintainers":[{"name":"bozonx","email":"ipkozyrin@gmail.com"}],"homepage":"https://github.com/bozonx/social-media-posting/tree/main/packages/platform-telegram#readme","bugs":{"url":"https://github.com/bozonx/social-media-posting/issues"},"dist":{"shasum":"6016abfeb98d8663d18dea99ccdd95e9a80322b9","tarball":"https://registry.npmjs.org/@bozonx/social-posting-telegram/-/social-posting-telegram-0.4.0.tgz","fileCount":24,"integrity":"sha512-ONI3xoGvk6ve4hjpWxPJAtsJ89z8dtfJYQUufRRvhhF7VwTumMKi52xjosWt/FnVLxuCsAl6qMn+4rd4B3HfbA==","signatures":[{"sig":"MEUCIBeBlC+6pchBycc5Rc8fJ9+PPT2uGkyr2rV/dihRRovBAiEAypaVFa7sDtY3ICRV27R+GfSPPaNwGK3RJX3NaOyU5JM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":73516},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=24.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","workerd":"./dist/index.js"}},"scripts":{"test":"pnpm -w exec vitest run --project platforms","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"bozonx","email":"ipkozyrin@gmail.com"},"repository":{"url":"git+https://github.com/bozonx/social-media-posting.git","type":"git","directory":"packages/platform-telegram"},"description":"Telegram platform for @bozonx/social-posting","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","dependencies":{},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@bozonx/social-posting":"0.4.0","@bozonx/social-posting-conformance":"0.4.0"},"peerDependencies":{"@bozonx/social-posting":"^0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/social-posting-telegram_0.4.0_1787264553634_0.6267281112197347","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@bozonx/social-posting-telegram","version":"0.5.1","keywords":["social-media","posting","telegram"],"author":"Ivan K","license":"MIT","_id":"@bozonx/social-posting-telegram@0.5.1","maintainers":[{"name":"bozonx","email":"ipkozyrin@gmail.com"}],"homepage":"https://github.com/bozonx/social-media-posting/tree/main/packages/platform-telegram#readme","bugs":{"url":"https://github.com/bozonx/social-media-posting/issues"},"dist":{"shasum":"929bae929cc0549cea2ddbdfcc1752469828bcdc","tarball":"https://registry.npmjs.org/@bozonx/social-posting-telegram/-/social-posting-telegram-0.5.1.tgz","fileCount":24,"integrity":"sha512-eR7aJ6cIm1Fqr7pkWNzH/oSOIcROlJcz7ESBfvvaGA4zVWO7pEMMAbskLF2OBNz7AgUYp68ZOTHlT6npdk2ptQ==","signatures":[{"sig":"MEYCIQDtw+dkttkd6uqqnp046yz2REr5tAtNNuB2pb+lOfm6xQIhAP47h5sR2dKgwAruE17C8Pj60j/PGotOCaEwXkrUKR46","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":73516},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=24.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","workerd":"./dist/index.js"}},"scripts":{"test":"pnpm -w exec vitest run --project platforms","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"bozonx","email":"ipkozyrin@gmail.com"},"repository":{"url":"git+https://github.com/bozonx/social-media-posting.git","type":"git","directory":"packages/platform-telegram"},"description":"Telegram platform for @bozonx/social-posting","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","dependencies":{},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@bozonx/social-posting":"0.5.1","@bozonx/social-posting-conformance":"0.5.1"},"peerDependencies":{"@bozonx/social-posting":"^0.5.1"},"_npmOperationalInternal":{"tmp":"tmp/social-posting-telegram_0.5.1_1787267091082_0.8930446570270645","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@bozonx/social-posting-telegram","version":"0.7.0","keywords":["social-media","posting","telegram"],"author":"Ivan K","license":"MIT","_id":"@bozonx/social-posting-telegram@0.7.0","maintainers":[{"name":"bozonx","email":"ipkozyrin@gmail.com"}],"homepage":"https://github.com/bozonx/social-media-posting/tree/main/packages/platform-telegram#readme","bugs":{"url":"https://github.com/bozonx/social-media-posting/issues"},"dist":{"shasum":"53da2470ce5904de91888ba48dea2be21587f1f4","tarball":"https://registry.npmjs.org/@bozonx/social-posting-telegram/-/social-posting-telegram-0.7.0.tgz","fileCount":24,"integrity":"sha512-MoIoEvhAzxly1kaszfCdRBgtNHVGeBX0igZlNLRJHHo6hriHGXzfjAbIzzqwwobU3w4Lga6Qjz5xVop4yifu3A==","signatures":[{"sig":"MEUCIB75QO0CRLZbD0eOJ5q2jTC603io4v8fHFMTL0ElHTLeAiEAuqt+rYVVSaZxEqFkG0jZTTyr23WjsurqmQRhA7T3sw8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":75598},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=24.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js","workerd":"./dist/index.js"}},"scripts":{"test":"pnpm -w exec vitest run --project platforms","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"bozonx","email":"ipkozyrin@gmail.com"},"repository":{"url":"git+https://github.com/bozonx/social-media-posting.git","type":"git","directory":"packages/platform-telegram"},"description":"Telegram platform for @bozonx/social-posting","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","dependencies":{},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@bozonx/social-posting":"0.7.0","@bozonx/social-posting-conformance":"0.7.0"},"peerDependencies":{"@bozonx/social-posting":"^0.7.0"},"_npmOperationalInternal":{"tmp":"tmp/social-posting-telegram_0.7.0_1788032539495_0.3785753316435554","host":"s3://npm-registry-packages-npm-production"}},"0.8.0":{"name":"@bozonx/social-posting-telegram","version":"0.8.0","description":"Telegram platform for @bozonx/social-posting","keywords":["social-media","posting","telegram"],"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","workerd":"./dist/index.js","import":"./dist/index.js","default":"./dist/index.js"}},"dependencies":{},"peerDependencies":{"@bozonx/social-posting":"^0.8.0"},"devDependencies":{"@bozonx/social-posting":"0.8.0","@bozonx/social-posting-conformance":"0.8.0"},"author":"Ivan K","license":"MIT","engines":{"node":">=24.0.0"},"repository":{"type":"git","url":"git+https://github.com/bozonx/social-media-posting.git","directory":"packages/platform-telegram"},"bugs":{"url":"https://github.com/bozonx/social-media-posting/issues"},"homepage":"https://github.com/bozonx/social-media-posting/tree/main/packages/platform-telegram#readme","publishConfig":{"access":"public","provenance":true},"sideEffects":false,"scripts":{"build":"tsc -p tsconfig.build.json","clean":"rm -rf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.json --noEmit","test":"pnpm -w exec vitest run --project platforms"},"_nodeVersion":"24.19.0","_id":"@bozonx/social-posting-telegram@0.8.0","dist":{"integrity":"sha512-Qnlfq6NDQaG9NqOxp/mZivvX2b2uYE1hdUzGEaLij/JqVgBbVDfeYlktVHAIRVia25bvnXgithUToUENW4mxWw==","shasum":"203337576c2d252481baa1c3f4434a76c472a0cf","tarball":"https://registry.npmjs.org/@bozonx/social-posting-telegram/-/social-posting-telegram-0.8.0.tgz","fileCount":24,"unpackedSize":78982,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFIVsu1W0S+CcfLfyI5em4dse3T9IyVK5M7uPlmbmKDoAiBtbeP645T9xd1FVTx1rutqB5I9Kp+owIZFLw1OFcaYnA=="}]},"_npmUser":{"name":"bozonx","email":"ipkozyrin@gmail.com"},"directories":{},"maintainers":[{"name":"bozonx","email":"ipkozyrin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/social-posting-telegram_0.8.0_1788181102897_0.31948661513949483"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-20T13:02:36.473Z","modified":"2026-08-31T12:58:23.387Z","0.3.0":"2026-08-20T13:02:36.805Z","0.4.0":"2026-08-20T22:22:33.769Z","0.5.1":"2026-08-20T23:04:51.222Z","0.7.0":"2026-08-29T19:42:19.665Z","0.8.0":"2026-08-31T12:58:23.043Z"},"bugs":{"url":"https://github.com/bozonx/social-media-posting/issues"},"author":"Ivan K","license":"MIT","homepage":"https://github.com/bozonx/social-media-posting/tree/main/packages/platform-telegram#readme","keywords":["social-media","posting","telegram"],"repository":{"type":"git","url":"git+https://github.com/bozonx/social-media-posting.git","directory":"packages/platform-telegram"},"description":"Telegram platform for @bozonx/social-posting","maintainers":[{"name":"bozonx","email":"ipkozyrin@gmail.com"}],"readme":"# @bozonx/social-posting-telegram\n\nTelegram Bot API support for [`@bozonx/social-posting`](https://www.npmjs.com/package/@bozonx/social-posting).\n\nTalks to the Bot API over plain `fetch` — no SDK, no dependencies — so it runs unchanged on Node,\nCloudflare Workers, Deno and Bun.\n\n```bash\npnpm add @bozonx/social-posting @bozonx/social-posting-telegram\n```\n\n```ts\nimport { createPostingClient } from '@bozonx/social-posting';\nimport { telegram } from '@bozonx/social-posting-telegram';\n\nconst client = createPostingClient({\n  accounts: {\n    myChannel: {\n      platform: 'telegram',\n      auth: { apiKey: process.env.TELEGRAM_BOT_TOKEN! },\n      target: '@my_channel',\n    },\n  },\n  platforms: [telegram],\n});\n```\n\n## Account configuration\n\n| Field               | Type             | Meaning                                            |\n| ------------------- | ---------------- | -------------------------------------------------- |\n| `auth.apiKey`       | string           | Bot token, `123456789:ABC-DEF…`                    |\n| `target`            | string \\| number | `@channel`, `-1001234567890`, or a numeric chat id |\n| `silent`            | boolean          | Send silently by default                           |\n| `apiTimeoutSeconds` | number           | Per-call Bot API timeout                           |\n| `maxBodyLength`     | number           | A stricter body limit than Telegram's own          |\n\nThe target chat is resolved from `request.target`, then the account's `target`.\n\n## Post types\n\n| Type       | Bot API method   |\n| ---------- | ---------------- |\n| `post`     | `sendMessage`    |\n| `image`    | `sendPhoto`      |\n| `video`    | `sendVideo`      |\n| `audio`    | `sendAudio`      |\n| `document` | `sendDocument`   |\n| `album`    | `sendMediaGroup` |\n| `poll`     | `sendPoll`       |\n\n### Automatic detection\n\nWith `type` omitted or `auto`, the first matching shape decides:\n\n- `poll` present → `poll`\n- `media[]` with multiple items → `album`\n- `media[]` with 1 item → matching kind (`image`, `video`, `audio`, `document`)\n- `body` only → `post`\n\n## Body formatting\n\nThe body is sent **as written**. `bodyFormat` only picks the Bot API's `parse_mode`:\n\n| `bodyFormat`                    | `parse_mode`             |\n| ------------------------------- | ------------------------ |\n| `text`                          | _(unset)_                |\n| `html`                          | `HTML`                   |\n| `md`                            | `Markdown`               |\n| `MarkdownV2` or any other value | passed through unchanged |\n\n```json\n{ \"body\": \"<b>Hello</b> <i>world</i>\", \"bodyFormat\": \"html\" }\n{ \"body\": \"*Hello* _world_\\\\!\", \"bodyFormat\": \"MarkdownV2\" }\n```\n\n`extra.parse_mode` always wins over `bodyFormat`.\n\n## Limits\n\n|               |                 |\n| ------------- | --------------- |\n| Text message  | 4096 characters |\n| Media caption | 1024 characters |\n| Album items   | 1–10            |\n| Poll options  | 2–10            |\n\nLimits are declared in the capability descriptor, so an over-long body or excess media is refused locally\nrather than after a round trip. Read them at runtime with `client.getCapabilities('telegram')`.\n\n## Media\n\nTelegram accepts a public URL or a `platformRef` containing a `file_id` it already stores. This\nadapter deliberately does not upload byte, Blob, or stream sources; inspect\n`capabilities.media[type].acceptedSources` when selecting transport.\n\n```json\n{\n  \"media\": [\n    {\n      \"type\": \"image\",\n      \"source\": { \"kind\": \"url\", \"url\": \"https://example.com/image.jpg\" },\n      \"sensitive\": true\n    }\n  ]\n}\n```\n\n## Extra fields\n\n`extra` accepts safe Bot API customizations using Telegram's own field names:\n\n```json\n{\n  \"extra\": {\n    \"reply_markup\": {\n      \"inline_keyboard\": [[{ \"text\": \"Visit\", \"url\": \"https://example.com\" }]]\n    },\n    \"link_preview_options\": { \"is_disabled\": true },\n    \"protect_content\": true,\n    \"reply_parameters\": { \"message_id\": 1234 }\n  }\n}\n```\n\nDestination and content fields (`chat_id`, `text`, `photo`, `video`, `audio`, `document`,\n`caption`, and `disable_notification`) cannot be supplied through `extra`. Use the corresponding\ntop-level request fields so validation, audit logs, and the actual Bot API call remain aligned.\n\n## Deletion\n\nTelegram supports message deletion via `client.delete(request, ref)`. Telegram messages can be deleted\nup to 48 hours after posting.\n\n## Fields Telegram ignores\n\n`title`, `description`, `language`, `tags` are accepted and reported as ignored in a preview\nwarning.\n\n`scheduledAt` and `mode: 'draft'` are **rejected**: Telegram schedules nothing and has no drafts,\nand quietly dropping them would be worse than refusing them.\n\n## Error mapping\n\n| Bot API              | Code               | Retryable                           |\n| -------------------- | ------------------ | ----------------------------------- |\n| 429                  | `RATE_LIMIT_ERROR` | yes, after `parameters.retry_after` |\n| 401, 403             | `AUTH_ERROR`       | no                                  |\n| 400, content refused | `CONTENT_REJECTED` | no                                  |\n| 400, other           | `VALIDATION_ERROR` | no                                  |\n| 5xx                  | `PLATFORM_ERROR`   | yes                                 |\n| no response          | `NETWORK_ERROR`    | yes                                 |\n\n## License\n\nMIT\n","readmeFilename":""}