{"id":13423902,"url":"https://github.com/franalgaba/chatgpt-telegram-bot-serverless","last_synced_at":"2025-10-20T02:37:00.420Z","repository":{"id":64205479,"uuid":"574081232","full_name":"franalgaba/chatgpt-telegram-bot-serverless","owner":"franalgaba","description":"ChatGPT Telegram Bot running in AWS Lambda","archived":false,"fork":false,"pushed_at":"2023-09-22T13:20:40.000Z","size":2298,"stargazers_count":321,"open_issues_count":2,"forks_count":55,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-03-15T17:37:21.414Z","etag":null,"topics":["aws-lambda","chatgpt","openai","python"],"latest_commit_sha":null,"homepage":"","language":"Python","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/franalgaba.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}},"created_at":"2022-12-04T11:23:08.000Z","updated_at":"2025-01-16T10:28:56.000Z","dependencies_parsed_at":"2024-01-06T21:51:38.918Z","dependency_job_id":"66fbec62-57e8-484d-89d2-23d21f80207f","html_url":"https://github.com/franalgaba/chatgpt-telegram-bot-serverless","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franalgaba%2Fchatgpt-telegram-bot-serverless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franalgaba%2Fchatgpt-telegram-bot-serverless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franalgaba%2Fchatgpt-telegram-bot-serverless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/franalgaba%2Fchatgpt-telegram-bot-serverless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/franalgaba","download_url":"https://codeload.github.com/franalgaba/chatgpt-telegram-bot-serverless/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247779741,"owners_count":20994572,"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":["aws-lambda","chatgpt","openai","python"],"created_at":"2024-07-31T00:00:44.683Z","updated_at":"2025-10-20T02:36:55.391Z","avatar_url":"https://github.com/franalgaba.png","language":"Python","funding_links":[],"categories":["Uncategorized","Bots","Chatbots","Official Resources","Integrations","聊天机器人","Chat bots","Thanks to all the contributors!","UIs","在任何地方使用 ChatGPT"],"sub_categories":["Uncategorized","Examples","Special-purpose","Access ChatGPT from other platforms","Telegram","Other","Messenger bots","聊天機器人"],"readme":"# ChatGPT Telegram Bot in AWS Lambda\n\nThis a Telegram bot that lets you chat with [ChatGPT](https://openai.com/blog/chatgpt/). This bot is created using the [__brand new ChatGPT API__](https://openai.com/blog/introducing-chatgpt-and-whisper-apis). The Telegram bot is deployed in completely serverless in AWS Lambda. No need to setup a local server or do login in the browser.\n\n# Features\n\n- [X] __New ChatGPT API support.__ :brain:\n- [X] __Voice messages support!__ :fire:\n- [X] __Markdown rendering support.__\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./img/chatgpt_animation_fast.gif\" width=\"500\"/\u003e\n\u003c/p\u003e\n\n# Initial Setup\n\n1. Create an [OpenAI account](https://openai.com/api/) and [get an API Key](https://platform.openai.com/account/api-keys).\n2. Create an [AWS account](https://aws.amazon.com/es/).\n3. Setup your Telegram bot. You can follow [this instructions](https://core.telegram.org/bots/tutorial#obtain-your-bot-token) to get your token.\n\n\u003cdetails\u003e\n[\u003cimg src=\"./img/session_token.png\" width=\"500\"/\u003e](/img/session_token.png)\n\u003c/details\u003e\n\n4. To enable support for voice messages you need to create a S3 bucket in your AWS account.\n- Go to the top search bar and write `S3`.\n\n\u003cdetails\u003e\n[\u003cimg src=\"./img/s3_browser.png\" width=\"500\"/\u003e](/img/s3_browser.png)\n\u003c/details\u003e\n\n- Click the Create Bucket button.\n\n\u003cdetails\u003e\n[\u003cimg src=\"./img/create_bucket_button.png\" width=\"500\"/\u003e](/img/create_bucket_button.png)\n\u003c/details\u003e\n\n- Configure the creation of your bucket. The name must be unique worldwide. Scroll to bottom and click Create Bucket and don't change any other configuration.\n\n\u003cdetails\u003e\n[\u003cimg src=\"./img/create_bucket_config.png\" width=\"500\"/\u003e](/img/create_bucket_config.png)\n\u003c/details\u003e\n\n5. Go to `.chalice/config.json` and stablish the configurations:\n- `TELEGRAM_TOKEN` with your Telegram token. \n- `OPENAI_API_KEY` with the value of your Open AI API Token.\n- `VOICE_MESSAGES_BUCKET` with the bucket name you created previously.\n\n# Installation\n\n1. Install Python using [pyenv](https://github.com/pyenv/pyenv-installer) or your prefered Python installation.\n2. Create a virtual environment: `python3 -m venv .venv`.\n3. Activate you virtual environment: `source .venv/bin/activate`.\n3. Install dependencies: `pip install -r requirements.txt`.\n4. [Install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) and [configure your credentials](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-quickstart.html).\n\n# Deployment\n\n1. Run `chalice deploy`.\n2. Go to the AWS Console -\u003e Lambda -\u003e chatgpt-telegram-bot-dev-message-handler-lambda -\u003e Configuration -\u003e Function URL.\n3. Click Create Function URL and set Auth type to NONE.\n4. Copy the created function URL.\n5. Stablish your Telegram webhook to point to you AWS Lambda running `curl --request POST --url https://api.telegram.org/bot\u003cYOUR_TELEGRAM_TOKEN\u003e/setWebhook --header 'content-type: application/json' --data '{\"url\": \"YOUR_FUNCTION_URL\"}'`\n\nGreat! Everything is setup :) Now go to Telegram and find your bot name and use ChatGPT from there!\n\n# Coming soon!\n\n- [X] Decoupled Token refresh in conversation.\n- [X] Increase response performance.\n- [X] Error handling from ChatGPT services.\n- [ ] Deploy solution with one-click using CloudFormation.\n\n# Credits\n\n-  [ChatGPT Telegram Bot - @altryne\n](https://github.com/altryne/chatGPT-telegram-bot)\n- [whatsapp-gpt](https://github.com/danielgross/whatsapp-gpt)\n- [ChatGPT Reverse Engineered API](https://github.com/acheong08/ChatGPT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranalgaba%2Fchatgpt-telegram-bot-serverless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffranalgaba%2Fchatgpt-telegram-bot-serverless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffranalgaba%2Fchatgpt-telegram-bot-serverless/lists"}