{"id":17707659,"url":"https://github.com/wdzeng/telegram-id-pretender","last_synced_at":"2025-10-19T10:50:28.789Z","repository":{"id":105361077,"uuid":"491611589","full_name":"wdzeng/telegram-id-pretender","owner":"wdzeng","description":"Peek at other's telegram username and take it over once available 👀👀","archived":false,"fork":false,"pushed_at":"2022-06-15T21:42:05.000Z","size":289,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-26T19:52:14.737Z","etag":null,"topics":["telegram"],"latest_commit_sha":null,"homepage":"","language":"Python","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/wdzeng.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":"2022-05-12T17:39:45.000Z","updated_at":"2024-07-26T02:34:14.000Z","dependencies_parsed_at":"2023-07-19T03:00:18.079Z","dependency_job_id":null,"html_url":"https://github.com/wdzeng/telegram-id-pretender","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wdzeng%2Ftelegram-id-pretender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wdzeng%2Ftelegram-id-pretender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wdzeng%2Ftelegram-id-pretender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wdzeng%2Ftelegram-id-pretender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wdzeng","download_url":"https://codeload.github.com/wdzeng/telegram-id-pretender/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243405743,"owners_count":20285811,"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"],"created_at":"2024-10-25T01:06:10.942Z","updated_at":"2025-10-19T10:50:23.740Z","avatar_url":"https://github.com/wdzeng.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram ID Pretender\n\n[![release](https://badgen.net/github/release/wdzeng/telegram-id-pretender/stable?color=red)](https://github.com/wdzeng/telegram-id-pretender/releases/latest)\n[![github](https://badgen.net/badge/icon/github/black?icon=github\u0026label=)](https://github.com/wdzeng/telegram-id-pretender)\n[![docker](https://badgen.net/badge/icon/docker?icon=docker\u0026label=)](https://hub.docker.com/repository/docker/hyperbola/telegram-id-pretender)\n\n![peek](res/peek.png)\n\n👀👀 Peek at other's Telegram username, taking it over once it is released. 👀👀\n\n## Install\n\n### Python\n\nPython 3.7 or up is required.\n\nThe [telethon](https://docs.telethon.dev/en/stable/) library is used.\n\n```bash\npip3 install telethon\n```\n\n### Docker\n\nUse the image on [dockerhub](https://hub.docker.com/repository/docker/hyperbola/telegram-id-pretender).\n\n```bash\ndocker pull hyperbola/telegram-id-pretender:1\n```\n\n#### Supported tags\n\n- `1`, `1.0`, `1.0.1`\n\n## Usage\n\nA running is an attempt to take over the username; therefore the script should be used with cron.\n\nFollowing command tries to update username to `fzhong`. You need an API key to use the script. You can generate one [here](https://my.telegram.org/apps).\n\n```bash\n# python\nTG_API_ID=\u003capi_id\u003e TG_API_HASH=\u003capi_hash\u003e python3 main.py fzhong\n\n# docker\ndocker run [-it]\\\n    -e TG_API_ID=\u003capi_id\u003e \\\n    -e TG_API_HASH=\u003capi_hash\u003e \n    hyperbola/telegram-id-pretender:1 fzhong\n```\n\nThe script should ask your login.\n\n\u003e **Warning**\n\u003e You should answer your mobile phone number in international format. For Taiwanese, use `+8869xxxxxxxxx` instead of `09xxxxxxxx`.\n\n## Automatic Login\n\nThe script asks your login interactively. To do automatic login, you can `-s \u003csession-file\u003e` to save and restore the login session.\n\n```bash\n# python\nTG_API_ID=\u003capi_id\u003e TG_API_HASH=\u003capi_hash\u003e python3 main.py -s /path/to/session/file fzhong\n\n# docker\ndocker run [-it] \\\n    -v /path/to/session:/session \\\n    -e TG_API_ID=\u003capi_id\u003e \\\n    -e TG_API_HASH=\u003capi_hash\u003e \\\n    hyperbola/telegram-id-pretender:1 -s /session fzhong\n```\n\nIf session file is specified, the script tries to read session token from the file and uses it to login; otherwise if session file does not exist, or if session token is invalid, the script prompts your login and then saves the updated token to session file so that it can perform automatic login in the next run. Keep session file secret since it contains sensitive data.\n\nIf the script is not running interactively, the session file must be specified. Otherwise the script fails without asking your login.\n\nSince telegram requires 2FA login and this action must be performed on the spot, there is no support automatic login by setting username and password.\n\n## Options\n\n- `--id` PATH: read telegram api id from this file\n- `--hash` PATH: read telegram api hash from this file\n- `-s`, `--session` PATH: read login token from this file\n- `-v`, `--verbose`: verbosity level; should be `0`, `1` or `2`; default to `1`\n- `-D`, `--no-prompt`: do not ask login even in interactive shell\n\nFollowing environment variables make effects. Noted that these variables refer to value directly, but not path to the value.\n\n- `TG_API_ID`: telegram api id; overrides `--id` option\n- `TG_API_HASH`: telegram api hash; overrides `--hash` option\n- `TG_SESSION`: login session; overrides `--session` option\n\n## Verbosity\n\nVerbosity can be set to either 0, 1, or 2 by `-v` flag. Control which message should be sent to your `Saved Messages` channel in your telegram account.\n\n- `0`: do not send any message\n- `1`: send critical messages only\n- `2`: send all messages\n\n## Exit Code\n\n- `0`: successfully took the desired username\n- `20`: desired username is occupied\n- `21`: desired username is invalid\n- `22`: desired username is already owned by you\n- `30`: failed to login\n- `87`: failed for flood\n- `1`: failed for any other reason\n\n## Sister Bots\n\n- [Shopee Coins Bot](https://github.com/wdzeng/shopee-coins-bot/)\n- [Pinkoi Coins Bot](https://github.com/wdzeng/pinkoi-coins-bot/)\n- [PTT Login Bot](https://github.com/wdzeng/ptt-login-bot/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwdzeng%2Ftelegram-id-pretender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwdzeng%2Ftelegram-id-pretender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwdzeng%2Ftelegram-id-pretender/lists"}