{"id":15669188,"url":"https://github.com/dcdunkan/deno-tg-file-id","last_synced_at":"2025-10-20T20:08:15.212Z","repository":{"id":62422775,"uuid":"502987552","full_name":"dcdunkan/deno-tg-file-id","owner":"dcdunkan","description":"Deno module for decoding file_id and file_unique_id of Telegram files.","archived":true,"fork":false,"pushed_at":"2022-06-13T14:29:15.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-16T00:12:57.965Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://deno.land/x/tg_file_id","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/dcdunkan.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":"2022-06-13T14:20:24.000Z","updated_at":"2024-06-15T20:42:30.000Z","dependencies_parsed_at":"2022-11-01T17:33:22.322Z","dependency_job_id":null,"html_url":"https://github.com/dcdunkan/deno-tg-file-id","commit_stats":null,"previous_names":["dcdunkan/deno-tg-file-id"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdunkan%2Fdeno-tg-file-id","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdunkan%2Fdeno-tg-file-id/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdunkan%2Fdeno-tg-file-id/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcdunkan%2Fdeno-tg-file-id/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcdunkan","download_url":"https://codeload.github.com/dcdunkan/deno-tg-file-id/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236451125,"owners_count":19150805,"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":[],"created_at":"2024-10-03T14:21:49.130Z","updated_at":"2025-10-14T05:31:48.913Z","avatar_url":"https://github.com/dcdunkan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e Deno port of [smaznet/tg-file-id](https://github.com/smaznet/tg-file-id)\n\n# tg-file-id\n\n[![deno module](https://shield.deno.dev/x/tg_file_id)](https://deno.land/x/tg_file_id)\n\nA simple [Deno](https://deno.land) module to decode file_id and file_unique_id\nof Bot API updates to get more information of Telegram files.\n\nPorted from https://github.com/smaznet/tg-file-id (Node.js)\n\nYou can find the Deno module here: https://deno.land/x/tg_file_id\n\n## Examples\n\n### file_id\n\n```ts\nimport { decodeFileId } from \"https://deno.land/x/tg_file_id/mod.ts\";\n\nconst result = decodeFileId(\n  \"AwACAgQAAxkBAAEE3SZgO-PbHlWtxRt5cPWvXlGRWHXM3AACuwgAAj0d4FF_jv-i_-7iQR4E\",\n);\n\nconsole.log(result);\n```\n\nOutput:\n\n```ts\n{\n  version: 4,\n  subVersion: 30,\n  typeId: 3,\n  dcId: 4,\n  hasReference: true,\n  hasWebLocation: false,\n  fileType: 'voice',\n  fileReference: '010004dd26603be3db1e55adc51b7970f5af5e51915875ccdc',\n  id: 5899747659685562555n,\n  access_hash: 4747619738920652415n\n}\n```\n\n### file_unique_id\n\n```ts\nimport { decodeUniqueFileId } from \"https://deno.land/x/tg_file_id/mod.ts\";\n\nconst result = decodeUniqueFileId(\"AgADuwgAAj0d4FE\");\n\nconsole.log(result);\n```\n\nOutput:\n\n```ts\n{\n  typeId: 2,\n  type: \"document\",\n  id: 5899747659685562555n\n};\n```\n\n### Convert file_id to file_unique_id\n\n```ts\nimport { FileId } from \"https://deno.land/x/tg_file_id/mod.ts\";\n\nconst uniqueFileId = FileId.fromFileId(\n  \"AwACAgQAAxkBAAEE3SZgO-PbHlWtxRt5cPWvXlGRWHXM3AACuwgAAj0d4FF_jv-i_-7iQR4E\",\n).toFileUniqueId();\n\nconsole.log(uniqueFileId); // =\u003e AwADuwgAAj0d4FE\n```\n\nCredits to the [original developer](https://github.com/smaznet).\n\nSee the [original repository](https://github.com/smaznet/tg-file-id) for more\ninformation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcdunkan%2Fdeno-tg-file-id","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcdunkan%2Fdeno-tg-file-id","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcdunkan%2Fdeno-tg-file-id/lists"}