{"id":26976976,"url":"https://github.com/fivlas/telegram-selfbot","last_synced_at":"2026-05-03T02:39:04.089Z","repository":{"id":278427387,"uuid":"935590293","full_name":"Fivlas/Telegram-Selfbot","owner":"Fivlas","description":"A Telegram self-bot powered by GPT-4o that automatically responds to private messages using OpenAI.","archived":false,"fork":false,"pushed_at":"2025-02-19T17:53:10.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-19T18:33:34.509Z","etag":null,"topics":["ai","selfbot","telegram","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Fivlas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-02-19T17:34:34.000Z","updated_at":"2025-02-19T17:54:48.000Z","dependencies_parsed_at":"2025-02-19T18:45:25.113Z","dependency_job_id":null,"html_url":"https://github.com/Fivlas/Telegram-Selfbot","commit_stats":null,"previous_names":["fivlas/telegram-selfbot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fivlas%2FTelegram-Selfbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fivlas%2FTelegram-Selfbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fivlas%2FTelegram-Selfbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Fivlas%2FTelegram-Selfbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Fivlas","download_url":"https://codeload.github.com/Fivlas/Telegram-Selfbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246998226,"owners_count":20866696,"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":["ai","selfbot","telegram","typescript"],"created_at":"2025-04-03T12:17:46.611Z","updated_at":"2026-05-03T02:38:59.068Z","avatar_url":"https://github.com/Fivlas.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram Self-Bot with OpenAI\nA Telegram self-bot powered by GPT-4o that automatically responds to private messages using OpenAI.\n\n## Features\n- Automatically responds to private messages  \n- Uses GPT-4o for intelligent conversations  \n- Secure authentication using Telegram's API  \n- Stores message history per user  \n\n## Setup \u0026 Installation\n\n### 1. Clone the Repository\n```sh\ngit clone https://github.com/yourusername/telegram-selfbot.git\ncd telegram-selfbot\n```\n### 2. Install Dependencies\n```sh\nnpm install\n```\n\n### Fill a .env File\nCreate a `.env` file in the project root and add the following environment variables:\n```sh\nTELEGRAM_SESSION=your_telegram_session_string\nAPP_ID=your_telegram_app_id\nAPI_HASH=your_telegram_api_hash\nOPENAI_API_KEY=your_openai_api_key\n```\nHow to get these values?\n- Get your `APP_ID` and `API_HASH` from my.telegram.org\n- Generate a `TELEGRAM_SESSION` using telegram.sessions.StringSession\n- Get an `OPENAI_API_KEY` from OpenAI\n\n### Running the Bot\nTo start the bot, run:\n\n```sh\nnpx tsx index.ts\n```\n\n### First-Time Setup\nOn the first, the bot will ask for:\n- Your **phone number** (linked to your Telegram account)\n- Your **Telegram login code** (sent via Telegram)\n- Your **Telegram password** (if 2FA is enabled)\n\nOnce logged in, the bot will start listening for private messages and responding automatically.\n\n### How It Works\n\n1. The bot listens for **new private messages**.\n2. It stores **message history per user**.\n3. It sends user messages to **OpenAI's GPT-4o**.\n4. The AI-generated response is **sent back to the user**.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivlas%2Ftelegram-selfbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffivlas%2Ftelegram-selfbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivlas%2Ftelegram-selfbot/lists"}