{"id":16802150,"url":"https://github.com/kamikazechaser/tg-resolve","last_synced_at":"2026-04-09T14:01:24.084Z","repository":{"id":71952324,"uuid":"71169915","full_name":"kamikazechaser/tg-resolve","owner":"kamikazechaser","description":"[Deprecated] 👤 A light Node.js Library that reolves Telegram usernames and/or ids to a complete User or/and Chat JSON object(s)","archived":false,"fork":false,"pushed_at":"2022-03-01T11:49:15.000Z","size":37,"stargazers_count":56,"open_issues_count":4,"forks_count":15,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-12T21:09:35.013Z","etag":null,"topics":["telegram","telegram-api","telegram-bot","tg-resolve"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/kamikazechaser.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}},"created_at":"2016-10-17T18:44:20.000Z","updated_at":"2025-02-28T13:38:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"39657b0a-e8e5-4184-b130-5084af119888","html_url":"https://github.com/kamikazechaser/tg-resolve","commit_stats":{"total_commits":31,"total_committers":4,"mean_commits":7.75,"dds":0.4516129032258065,"last_synced_commit":"9f0d62bbb44326f0fb31f3a93b1c5172490aaa50"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamikazechaser%2Ftg-resolve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamikazechaser%2Ftg-resolve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamikazechaser%2Ftg-resolve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamikazechaser%2Ftg-resolve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamikazechaser","download_url":"https://codeload.github.com/kamikazechaser/tg-resolve/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841203,"owners_count":20356443,"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":["telegram","telegram-api","telegram-bot","tg-resolve"],"created_at":"2024-10-13T09:38:48.986Z","updated_at":"2026-04-09T14:01:24.015Z","avatar_url":"https://github.com/kamikazechaser.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://img.shields.io/npm/dt/tg-resolve.svg?style=flat-square)](https://www.npmjs.com/package/tg-resolve)\n[![https://telegram.me/kamikazechaser](https://img.shields.io/badge/%F0%9F%92%AC_Telegram-kamikazechaser-blue.svg?style=flat-square)](https://telegram.me/kamikazechaser)\n[![Travis](https://img.shields.io/travis/kamikazechaser/tg-resolve.svg?style=flat-square)](https://travis-ci.org/kamikazechaser/tg-resolve)\n\u003e 👤 tg-resolve\n\nA light Node.js Library that resolves Telegram usernames and/or ids to a complete User or/and Chat JSON object(s)\n\n\u003e Powered by [PWRTelegram API](http://pwrtelegram.xyz/)\n\n## Background\n\nThe official Telegram API **does not** allow bots to resolve usernames/ids out of the box. One is forced to create his/her own database so as to resolve usernames. Resolving of usernames is particularly useful in that a bot is able to get a user/chat id of a person or groub it hasn't even seen! Unlike before where a bot is only able to see a person if it has ever recieved his/her message whether in private or in a group.\n\n## Useful Scenarios\n\n- Group administration bots\n- In a bot which has lost its database, but users had previously started the bot\n- General resolving to get user details e.g [UResolverBot](https://telegram.me/UResolverBot)\n- And much more!\n\n\n## Install\n\n```bash\n$ npm install tg-resolve --save\n```\n\n## Usage\n\n```js\nconst tgresolve = require(\"tg-resolve\");\n\n// using the 'bare' function\ntgresolve(token, \"@kamikazechaser\", function(error, result) {\n    // ... handle error ...\n    console.log(result.id);\n});\n\n// you can create a client (referred to as 'resolver')\n// that you can repeatedly use\nconst resolver = new tgresolve.Tgresolve(token);\n\n// using the 'resolver'\nresolver.tgresolve(\"@kamikazechaser\", function(error, result) {\n    // ... handle error ...\n    console.log(result.id);\n});\n```\n\n_Refer to [example.js](https://github.com/kamikazechaser/tg-resolve/blob/master/example.js) for a more comprehensive guide_\n\n- As of v1.2.0, you will need your own bot token!\n- As of v1.3.0, you can pass in your own pwrtg url!\n\n\n\u003ca name=\"above-main\"\u003e\u003c/a\u003e\n#### tgresolve(token, username[, options], callback)\n\nResolve the `username` to a [Result](#result).\n\n* **token** (String): Telegram bot token\n* **username** (String)\n* **options** (Object, Optional)\n    * **url** (String): custom [PWRTelegram API](http://pwrtelegram.xyz/) URL\n* **callback** (Function):\n    * signature: `callback(error, result)`\n\n\n#### resolver = new tgresolve.Tgresolve(token[, options])\n\nCreate a client/resolver.\n\n* **token** (String): Telegram bot token\n* **options** (Object, Optional): same as [above](#above-main)\n\n\n#### resolver.tgresolve(username, callback)\n\nResolve the `username` to a [Result](#result), using the client.\n\n* **username** (String)\n* **callback** (Function): same as [above](#above-main)\n\n\n\u003ca name=\"result\"\u003e\u003c/a\u003e\n## Result\n\n_When resolving for a Group/Channel_\n\n```js\n{\n    id: -1001065761006,\n    title: \"End Of The World Party\",\n    username: \"EOTWGroup\",\n    type: \"supergroup\",\n    when: \"2016-10-18 11:22:56\"\n}\n```\n\n_When resolving for a User_\n\n```js\n{\n    id: 58258161,\n    first_name: \"John\",\n    username: \"john_doe\",\n    type: \"private\",\n    last_name: \"Doe\",\n    when: \"2016-10-18 11:22:56\"\n}\n```\n\n\n## Issues And Contribution\n\nFork the repository and submit a pull request for whatever change you want to be added to this project. If you have any questions, just open an issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamikazechaser%2Ftg-resolve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamikazechaser%2Ftg-resolve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamikazechaser%2Ftg-resolve/lists"}