{"_id":"@alessandromatera/node-red-telegram-api","_rev":"5-8f13bf8487e636df98462be7f04805c4","name":"@alessandromatera/node-red-telegram-api","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@alessandromatera/node-red-telegram-api","version":"0.1.0","keywords":["node-red","telegram","mtproto","gramjs"],"author":{"name":"Alessandro"},"license":"MIT","_id":"@alessandromatera/node-red-telegram-api@0.1.0","maintainers":[{"name":"alessandromatera","email":"alessandromatera@gmail.com"}],"homepage":"https://github.com/alessandromatera/telegram-api#readme","bugs":{"url":"https://github.com/alessandromatera/telegram-api/issues"},"dist":{"shasum":"7858d64f9b1b6ec4278f3965fd56d3e01fffae72","tarball":"https://registry.npmjs.org/@alessandromatera/node-red-telegram-api/-/node-red-telegram-api-0.1.0.tgz","fileCount":31,"integrity":"sha512-KMMgTbJdmTmjVzG3LKh7dLrguqzKo6ioKAmgVvLp1v8EeCYRxi+wi50+WdJh1feRigMWF7rwMnypzS+5nIpbxg==","signatures":[{"sig":"MEQCIQCvvbFPafnxhsiP6rVgl4HFfzD/pNpKEEdnYdkbFkIPyAIfV00PJUZidEMF/2j+FQ4/AEwHoljzp+MI1vj0tj+P4w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":120893},"main":"dist/nodes/telegram-api.js","types":"./dist/nodes/telegram-api.d.ts","engines":{"node":">=20.0.0"},"gitHead":"84687a8c7862cf426c7fdfaebe9423e68355bebb","scripts":{"test":"vitest run","build":"npm run clean && tsc -p tsconfig.json && node scripts/copy-static.mjs","clean":"node scripts/clean.mjs","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"alessandromatera","email":"alessandromatera@gmail.com"},"node-red":{"nodes":{"telegram-api":"dist/nodes/telegram-api.js"},"version":">=4.0.0"},"repository":{"url":"git+https://github.com/alessandromatera/telegram-api.git","type":"git"},"_npmVersion":"11.11.0","description":"Node-RED palette for Telegram user-account automation over MTProto.","directories":{},"_nodeVersion":"25.8.1","dependencies":{"telegram":"^2.26.8","big-integer":"^1.6.52"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.8","typescript":"^5.8.2","@types/node":"^22.13.14"},"_npmOperationalInternal":{"tmp":"tmp/node-red-telegram-api_0.1.0_1774191887092_0.6928858735915095","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@alessandromatera/node-red-telegram-api","version":"0.1.1","keywords":["node-red","telegram","mtproto","gramjs"],"author":{"name":"Alessandro"},"license":"MIT","_id":"@alessandromatera/node-red-telegram-api@0.1.1","maintainers":[{"name":"alessandromatera","email":"alessandromatera@gmail.com"}],"homepage":"https://github.com/alessandromatera/telegram-api#readme","bugs":{"url":"https://github.com/alessandromatera/telegram-api/issues"},"dist":{"shasum":"9c5c636d45f89b298bc3f23273787248acb2dad6","tarball":"https://registry.npmjs.org/@alessandromatera/node-red-telegram-api/-/node-red-telegram-api-0.1.1.tgz","fileCount":31,"integrity":"sha512-IPdzgzqEZfx4Y6b8WWEo7x/taPYjrieKwXl4KjUvix107GKaCPBfPMXrAE6C3ci3CZw/FVmrO+MjYTsa+Z7ToA==","signatures":[{"sig":"MEQCIGCPJ5YbHQs3u8Y+UEbNXeIflb4tg9IRhaOwMKeE10oCAiBc4dGwd3F8H0XSNEpk3zVkCl+M7RJemQrNDs7AdQ09Qg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":121648},"main":"dist/nodes/telegram-api.js","types":"./dist/nodes/telegram-api.d.ts","engines":{"node":">=20.0.0"},"gitHead":"6026c2ebe180703fb0e2ee5e140586273b99af19","scripts":{"test":"vitest run","build":"npm run clean && tsc -p tsconfig.json && node scripts/copy-static.mjs","clean":"node scripts/clean.mjs","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"alessandromatera","email":"alessandromatera@gmail.com"},"node-red":{"nodes":{"telegram-api":"dist/nodes/telegram-api.js"},"version":">=4.0.0"},"repository":{"url":"git+https://github.com/alessandromatera/telegram-api.git","type":"git"},"_npmVersion":"11.11.0","description":"Node-RED palette for Telegram user-account automation over MTProto.","directories":{},"_nodeVersion":"25.8.1","dependencies":{"telegram":"^2.26.8","big-integer":"^1.6.52"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.8","typescript":"^5.8.2","@types/node":"^22.13.14"},"_npmOperationalInternal":{"tmp":"tmp/node-red-telegram-api_0.1.1_1775986833572_0.07521952427342637","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@alessandromatera/node-red-telegram-api","version":"0.2.0","keywords":["node-red","telegram","mtproto","gramjs"],"author":{"name":"Alessandro"},"license":"MIT","_id":"@alessandromatera/node-red-telegram-api@0.2.0","maintainers":[{"name":"alessandromatera","email":"alessandromatera@gmail.com"}],"homepage":"https://github.com/alessandromatera/telegram-api#readme","bugs":{"url":"https://github.com/alessandromatera/telegram-api/issues"},"dist":{"shasum":"32adff6d3dbbc7c41e574648b13d8f74ef0ae600","tarball":"https://registry.npmjs.org/@alessandromatera/node-red-telegram-api/-/node-red-telegram-api-0.2.0.tgz","fileCount":31,"integrity":"sha512-m9cckedCGf1B5z03HejKh5208h9duBGDl+5aBHuJDBhZQQehfnEwpobIdGUfk8sF8ecPYTWkcC+gYE1C4bmdRA==","signatures":[{"sig":"MEYCIQDZkJSxtO2klNRiIJrRBDzuy07rcAAjK7rNKQ2dTKZ25QIhALGi9g5RLccq+6j7n5mqQevq/m79OuwCYmFpe2LdyUr4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":133658},"main":"dist/nodes/telegram-api.js","types":"./dist/nodes/telegram-api.d.ts","engines":{"node":">=20.0.0"},"gitHead":"84d046d157712c2ea7cdbc8f0227c9a856f209a0","scripts":{"test":"vitest run","build":"npm run clean && tsc -p tsconfig.json && node scripts/copy-static.mjs","clean":"node scripts/clean.mjs","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"alessandromatera","email":"alessandromatera@gmail.com"},"node-red":{"nodes":{"telegram-api":"dist/nodes/telegram-api.js"},"version":">=4.0.0"},"repository":{"url":"git+https://github.com/alessandromatera/telegram-api.git","type":"git"},"_npmVersion":"11.12.1","description":"Node-RED palette for Telegram user-account automation over MTProto.","directories":{},"_nodeVersion":"26.0.0","dependencies":{"telegram":"^2.26.8","big-integer":"^1.6.52"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.8","typescript":"^5.8.2","@types/node":"^22.13.14"},"_npmOperationalInternal":{"tmp":"tmp/node-red-telegram-api_0.2.0_1788592421569_0.6017986848369463","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@alessandromatera/node-red-telegram-api","version":"0.2.1","keywords":["node-red","telegram","mtproto","gramjs"],"author":{"name":"Alessandro"},"license":"MIT","_id":"@alessandromatera/node-red-telegram-api@0.2.1","maintainers":[{"name":"alessandromatera","email":"alessandromatera@gmail.com"}],"homepage":"https://github.com/alessandromatera/telegram-api#readme","bugs":{"url":"https://github.com/alessandromatera/telegram-api/issues"},"dist":{"shasum":"1638a72a023dae08153167c77a7e8d0f6baee531","tarball":"https://registry.npmjs.org/@alessandromatera/node-red-telegram-api/-/node-red-telegram-api-0.2.1.tgz","fileCount":31,"integrity":"sha512-WYe17KVEnxIIpJNdH5bt+stgl841f/lqi3kd6jBj9UCWzh2GMyhDf96hhXeUwqdiP2Az0O207olPF2h8zdNi4g==","signatures":[{"sig":"MEYCIQCiq8+dZAfPRInoTex2tUtFeomduool7DFIrbZk3ECEeAIhAJnbJ/25JOMv2Y+BzzPJ88M6ruYA+l3EqV/+va7VFMd0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDw281UwZtFiSzQ27hBuXUfgk8srPFepnwbO74JhkM37QIhANB5Yx+oEIGgWqKAL7lBpxzjXRmiDzKkz25OmqoLvHSS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":137617},"main":"dist/nodes/telegram-api.js","types":"./dist/nodes/telegram-api.d.ts","engines":{"node":">=20.0.0"},"gitHead":"4f256654eb17c35c75939baf6ba1f798e82c80ed","scripts":{"test":"vitest run","build":"npm run clean && tsc -p tsconfig.json && node scripts/copy-static.mjs","clean":"node scripts/clean.mjs","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"alessandromatera","email":"alessandromatera@gmail.com"},"node-red":{"nodes":{"telegram-api":"dist/nodes/telegram-api.js"},"version":">=4.0.0"},"repository":{"url":"git+https://github.com/alessandromatera/telegram-api.git","type":"git"},"_npmVersion":"11.12.1","description":"Node-RED palette for Telegram user-account automation over MTProto.","directories":{},"_nodeVersion":"26.0.0","dependencies":{"telegram":"^2.26.8","big-integer":"^1.6.52"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.8","typescript":"^5.8.2","@types/node":"^22.13.14"},"_npmOperationalInternal":{"tmp":"tmp/node-red-telegram-api_0.2.1_1790172009187_0.6169245544783906","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"_id":"@alessandromatera/node-red-telegram-api@0.2.2","bugs":{"url":"https://github.com/alessandromatera/telegram-api/issues"},"dist":{"shasum":"860cee966196e7906cb10400bee90d0a3258e709","tarball":"https://registry.npmjs.org/@alessandromatera/node-red-telegram-api/-/node-red-telegram-api-0.2.2.tgz","fileCount":34,"integrity":"sha512-w10HjiCXrAiXZ/zNWAAg3OFbHyBpcMOrewJwER3Ra3PBMubsLaTekiRbH2fCqO/vIb+u688/t0FWPCsZG3KmqQ==","signatures":[{"sig":"MEQCIFVgXxDSG0N+T2V0KdETlPsEGrMqiw7kkAs5t78C69gzAiALSLnoOgX5I6G4ZnCkwfsl+RI+eCZ618wjfgvpHlA0Gg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAjj9B5bZ2jreSW7KJxvkcDL1Bio3CeSF4YxnKKtOJhSAiAb+rLTxIopMk2ccm7h4OBSExMOX59eHr2Sdd1ia8I2gA=="}],"unpackedSize":142087},"main":"dist/nodes/telegram-api.js","name":"@alessandromatera/node-red-telegram-api","types":"./dist/nodes/telegram-api.d.ts","author":{"name":"Alessandro"},"engines":{"node":">=20.0.0"},"gitHead":"a62adab3d818366f1f1694576baefdb06b12db12","license":"MIT","scripts":{"test":"vitest run","build":"npm run clean && tsc -p tsconfig.json && node scripts/copy-static.mjs","clean":"node scripts/clean.mjs","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"version":"0.2.2","_npmUser":{"name":"alessandromatera","email":"alessandromatera@gmail.com"},"homepage":"https://github.com/alessandromatera/telegram-api#readme","keywords":["node-red","telegram","mtproto","gramjs"],"node-red":{"nodes":{"telegram-api":"dist/nodes/telegram-api.js"},"version":">=4.0.0"},"repository":{"url":"git+https://github.com/alessandromatera/telegram-api.git","type":"git"},"_npmVersion":"11.12.1","description":"Node-RED palette for Telegram user-account automation over MTProto.","directories":{},"maintainers":[{"name":"alessandromatera","email":"alessandromatera@gmail.com"}],"_nodeVersion":"26.0.0","dependencies":{"telegram":"^2.26.8","big-integer":"^1.6.52"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.8","typescript":"^5.8.2","@types/node":"^22.13.14"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/node-red-telegram-api_0.2.2_1790173670890_0.041922837783299416"}}},"time":{"created":"2026-03-22T15:04:47.010Z","modified":"2026-09-23T14:27:51.167Z","0.1.0":"2026-03-22T15:04:47.246Z","0.1.1":"2026-04-12T09:40:33.708Z","0.2.0":"2026-09-05T07:13:41.716Z","0.2.1":"2026-09-23T14:00:09.268Z","0.2.2":"2026-09-23T14:27:50.993Z"},"bugs":{"url":"https://github.com/alessandromatera/telegram-api/issues"},"author":{"name":"Alessandro"},"license":"MIT","homepage":"https://github.com/alessandromatera/telegram-api#readme","keywords":["node-red","telegram","mtproto","gramjs"],"repository":{"url":"git+https://github.com/alessandromatera/telegram-api.git","type":"git"},"description":"Node-RED palette for Telegram user-account automation over MTProto.","maintainers":[{"name":"alessandromatera","email":"alessandromatera@gmail.com"}],"readme":"# @alessandromatera/node-red-telegram-api\n\nNode-RED palette for driving a real Telegram user account over MTProto with [GramJS](https://gram.js.org/), rather than the Telegram Bot API.\n\n## What it includes\n\n- `telegram-api-config`: stores `api_id`, `api_hash`, phone number, reconnect settings, and the encrypted session string\n- `telegram-api-in`: emits incoming messages as normalized Node-RED messages, optionally ignoring outgoing/self live events\n- `telegram-api-send`: sends text or media to a peer\n- `telegram-api-history`: fetches recent messages for a peer, optionally only unread incoming messages\n\n## Runtime requirements\n\n- Node.js 20+\n- Node-RED 4+\n- A Telegram API app created at [my.telegram.org](https://my.telegram.org)\n\n## Install from npm\n\n```bash\ncd ~/.node-red\nnpm install @alessandromatera/node-red-telegram-api\n```\n\nThen restart Node-RED and add the `telegram user` nodes from the palette.\n\n## Install locally for development\n\n```bash\nnpm install\nnpm run build\ncd ~/.node-red\nnpm install /absolute/path/to/telegram-api\n```\n\n## Get your API ID and API hash\n\nTelegram requires your own app credentials for MTProto user-account access.\n\n1. Sign in to Telegram with an official app using the phone number you want to use.\n2. Open [my.telegram.org](https://my.telegram.org) and log in with that same phone number.\n3. Open [API development tools](https://my.telegram.org/apps).\n4. Fill in the app form with any name, short name, and basic platform details.\n5. Save the form and copy the generated `api_id` and `api_hash`.\n\nNotes:\n\n- Telegram’s official docs for this flow are here: [Creating your Telegram Application](https://core.telegram.org/api/obtaining_api_id).\n- Telegram says each phone number can only have one `api_id` connected to it, so reuse the same credentials for this palette.\n- Keep `api_hash` private. Treat it like a password.\n\n## Login flow\n\n1. Open the `telegram-api-config` node.\n2. Enter `API ID`, `API Hash`, and your phone number.\n3. Click `Connect`.\n4. Enter the login code Telegram sends you.\n5. If 2FA is enabled, enter the password.\n6. Save and deploy after the session is captured.\n\nThe runtime reconnects with the stored session string after restart. If you open an existing config later, `Test Connection` checks the deployed runtime session. If you need a fresh session, re-enter the `API Hash` and run `Connect` again.\n\n## Example Node-RED flow\n\nThe same three nodes are also available as ready-made examples in the Node-RED editor under `Menu -> Import -> Examples -> @alessandromatera/node-red-telegram-api`.\n\nOr import this JSON from the Node-RED editor (`Menu -> Import -> Clipboard`) to get a starter flow with:\n\n- one `telegram-api-config` node\n- one `telegram-api-send` example that sends to Saved Messages\n- one `telegram-api-in` listener that prints incoming messages\n- one `telegram-api-history` example that reads the last 5 messages from Saved Messages\n\nAfter importing:\n\n1. Open the `My Telegram` config node.\n2. Enter your `API ID`, `API Hash`, and phone number.\n3. Click `Connect`, complete the login flow, then `Deploy`.\n4. Use the inject nodes to test sending and reading history.\n\n```json\n[\n  {\n    \"id\": \"a1f4d7c2e9b00101\",\n    \"type\": \"tab\",\n    \"label\": \"Telegram User Example\",\n    \"disabled\": false,\n    \"info\": \"\"\n  },\n  {\n    \"id\": \"b2f4d7c2e9b00102\",\n    \"type\": \"telegram-api-config\",\n    \"name\": \"My Telegram\",\n    \"reconnectMinMs\": \"2000\",\n    \"reconnectMaxMs\": \"30000\",\n    \"downloadDir\": \"\"\n  },\n  {\n    \"id\": \"c3f4d7c2e9b00103\",\n    \"type\": \"inject\",\n    \"z\": \"a1f4d7c2e9b00101\",\n    \"name\": \"Send test message\",\n    \"props\": [\n      {\n        \"p\": \"payload\"\n      }\n    ],\n    \"repeat\": \"\",\n    \"crontab\": \"\",\n    \"once\": false,\n    \"onceDelay\": 0.1,\n    \"topic\": \"\",\n    \"payload\": \"hello from Node-RED\",\n    \"payloadType\": \"str\",\n    \"x\": 170,\n    \"y\": 100,\n    \"wires\": [\n      [\n        \"d4f4d7c2e9b00104\"\n      ]\n    ]\n  },\n  {\n    \"id\": \"d4f4d7c2e9b00104\",\n    \"type\": \"telegram-api-send\",\n    \"z\": \"a1f4d7c2e9b00101\",\n    \"name\": \"Send to Saved Messages\",\n    \"account\": \"b2f4d7c2e9b00102\",\n    \"peer\": \"me\",\n    \"x\": 470,\n    \"y\": 100,\n    \"wires\": [\n      [\n        \"e5f4d7c2e9b00105\"\n      ]\n    ]\n  },\n  {\n    \"id\": \"e5f4d7c2e9b00105\",\n    \"type\": \"debug\",\n    \"z\": \"a1f4d7c2e9b00101\",\n    \"name\": \"Send result\",\n    \"active\": true,\n    \"tosidebar\": true,\n    \"console\": false,\n    \"tostatus\": false,\n    \"complete\": \"true\",\n    \"targetType\": \"full\",\n    \"x\": 760,\n    \"y\": 100,\n    \"wires\": []\n  },\n  {\n    \"id\": \"f6f4d7c2e9b00106\",\n    \"type\": \"telegram-api-in\",\n    \"z\": \"a1f4d7c2e9b00101\",\n    \"name\": \"Incoming messages\",\n    \"account\": \"b2f4d7c2e9b00102\",\n    \"includeRaw\": false,\n    \"unreadOnly\": false,\n    \"x\": 190,\n    \"y\": 200,\n    \"wires\": [\n      [\n        \"07f4d7c2e9b00107\"\n      ]\n    ]\n  },\n  {\n    \"id\": \"07f4d7c2e9b00107\",\n    \"type\": \"debug\",\n    \"z\": \"a1f4d7c2e9b00101\",\n    \"name\": \"Incoming debug\",\n    \"active\": true,\n    \"tosidebar\": true,\n    \"console\": false,\n    \"tostatus\": false,\n    \"complete\": \"true\",\n    \"targetType\": \"full\",\n    \"x\": 470,\n    \"y\": 200,\n    \"wires\": []\n  },\n  {\n    \"id\": \"18f4d7c2e9b00108\",\n    \"type\": \"inject\",\n    \"z\": \"a1f4d7c2e9b00101\",\n    \"name\": \"Read last 5\",\n    \"props\": [\n      {\n        \"p\": \"payload\"\n      }\n    ],\n    \"repeat\": \"\",\n    \"crontab\": \"\",\n    \"once\": false,\n    \"onceDelay\": 0.1,\n    \"topic\": \"\",\n    \"payload\": \"\",\n    \"payloadType\": \"date\",\n    \"x\": 150,\n    \"y\": 300,\n    \"wires\": [\n      [\n        \"29f4d7c2e9b00109\"\n      ]\n    ]\n  },\n  {\n    \"id\": \"29f4d7c2e9b00109\",\n    \"type\": \"telegram-api-history\",\n    \"z\": \"a1f4d7c2e9b00101\",\n    \"name\": \"Saved Messages History\",\n    \"account\": \"b2f4d7c2e9b00102\",\n    \"peer\": \"me\",\n    \"limit\": \"5\",\n    \"includeRaw\": false,\n    \"x\": 460,\n    \"y\": 300,\n    \"wires\": [\n      [\n        \"3af4d7c2e9b0010a\"\n      ]\n    ]\n  },\n  {\n    \"id\": \"3af4d7c2e9b0010a\",\n    \"type\": \"debug\",\n    \"z\": \"a1f4d7c2e9b00101\",\n    \"name\": \"History debug\",\n    \"active\": true,\n    \"tosidebar\": true,\n    \"console\": false,\n    \"tostatus\": false,\n    \"complete\": \"true\",\n    \"targetType\": \"full\",\n    \"x\": 750,\n    \"y\": 300,\n    \"wires\": []\n  }\n]\n```\n\nThe peer `me` is your own Saved Messages chat. You can replace it with any username or numeric peer id once the flow is working.\n\n## Message contract\n\nIncoming and action nodes use this shape:\n\n- `msg.payload`: the main payload for the node\n- `msg.telegram`: normalized Telegram metadata\n\nCommon metadata fields:\n\n- `msg.telegram.peer`: `{ id, type, username, title, ref }`\n- `msg.telegram.chatId`\n- `msg.telegram.senderId`\n- `msg.telegram.messageId`\n- `msg.telegram.media`\n- `msg.telegram.raw` when the node is configured with `Include Raw`\n\n`telegram-api-in` node options:\n\n- `Unread Only`: ignores outgoing/self live events and only emits unread incoming live messages\n- This is a live event filter only. It does not backfill unread messages that arrived before the node started\n\n## Send node input patterns\n\nText only:\n\n```json\n{\n  \"payload\": \"hello from Node-RED\",\n  \"telegram\": {\n    \"peer\": \"@username\"\n  }\n}\n```\n\nMedia by local path:\n\n```json\n{\n  \"payload\": {\n    \"caption\": \"daily report\",\n    \"mediaPath\": \"/tmp/report.pdf\"\n  },\n  \"telegram\": {\n    \"peer\": \"@username\"\n  }\n}\n```\n\nMedia by Buffer:\n\n```js\nmsg.payload = Buffer.from(\"...\");\nmsg.telegram = {\n  peer: \"@username\",\n  fileName: \"image.jpg\",\n  caption: \"generated by a flow\"\n};\nreturn msg;\n```\n\nHistory node input supports:\n\n- `msg.telegram.peer` to override the configured peer\n- `msg.telegram.limit` or `msg.limit` to control how many messages are returned\n- `msg.telegram.offsetId` or `msg.offsetId` to paginate older history\n- `msg.telegram.unreadOnly` or `msg.unreadOnly` to return only unread incoming messages\n\n## Current v1 scope\n\n- Incoming messages via `NewMessage`\n- Text and media sends\n- Basic history fetch\n\nNot included yet:\n\n- secret chats\n- edits/deletes\n- contact management\n- stories, calls, or generic low-level MTProto requests\n","readmeFilename":"README.md"}