[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-yym68686--ChatGPT-Telegram-Bot":3,"tool-yym68686--ChatGPT-Telegram-Bot":61},[4,18,26,36,44,52],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",141543,2,"2026-04-06T11:32:54",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107888,"2026-04-06T11:32:50",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":53,"name":54,"github_repo":55,"description_zh":56,"stars":57,"difficulty_score":10,"last_commit_at":58,"category_tags":59,"status":17},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[14,15,13,60],"视频",{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":72,"owner_avatar_url":73,"owner_bio":74,"owner_company":75,"owner_location":76,"owner_email":77,"owner_twitter":72,"owner_website":78,"owner_url":79,"languages":80,"stars":93,"forks":94,"last_commit_at":95,"license":96,"difficulty_score":32,"env_os":97,"env_gpu":98,"env_ram":98,"env_deps":99,"category_tags":105,"github_topics":107,"view_count":32,"oss_zip_url":127,"oss_zip_packed_at":127,"status":17,"created_at":128,"updated_at":129,"faqs":130,"releases":160},4594,"yym68686\u002FChatGPT-Telegram-Bot","ChatGPT-Telegram-Bot","TeleChat: 🤖️ an AI chat Telegram bot can Web Search Powered by GPT-5, DALL·E , Groq, Gemini 2.5 Pro\u002FFlash and the official Claude4.1 API using Python on Zeabur, fly.io and Replit.","ChatGPT-Telegram-Bot 是一款功能强大的 Telegram 机器人，旨在让用户在即时通讯软件中直接体验顶尖人工智能服务。它完美解决了用户无法在移动端便捷访问多模型 AI、处理复杂文件以及进行联网搜索的痛点。无论是普通用户希望随时随地获取资讯、总结文档，还是开发者需要快速搭建私有化 AI 助手，它都能提供流畅的支持。\n\n该工具的核心亮点在于其广泛的兼容性与丰富的功能生态。它不仅支持 OpenAI 格式接口，还能通过集成方案接入 Claude、Gemini、Groq 等全球主流大模型，并具备语音、图片及 PDF 等多模态问答能力。内置的网页搜索、论文摘要和代码解释器插件，让它成为得力的全能助理。此外，ChatGPT-Telegram-Bot 独创了群组话题隔离模式，确保不同对话场景下的配置与历史互不干扰；其异步多线程架构保障了高并发下的响应速度，而自动合并长文本的功能则突破了平台消息长度限制。配合一键式低成本部署方案，即使是技术新手也能轻松拥有个性化的 AI 伙伴。","\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyym68686_ChatGPT-Telegram-Bot_readme_35000cfa7343.jpg\">\n\u003C\u002Fp>\n\n# 🤖️ TeleChat\n\n[English](README.md) | [Chinese](README_CN.md)\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Ft.me\u002F+_01cz9tAkUc1YzZl\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FJoin Telegram Group-blue?&logo=telegram\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Ft.me\u002Fchatgpt68_bot\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTelegram Bot-grey?&logo=Probot\">\n  \u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fhub.docker.com\u002Frepository\u002Fdocker\u002Fyym68686\u002Fchatgpt\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fdocker\u002Fpulls\u002Fyym68686\u002Fchatgpt?color=blue\" alt=\"docker pull\">\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\nChatGPT Telegram Bot is a powerful Telegram bot that supports OpenAI-compatible large language model APIs. It enables users to have efficient conversations and information searches on Telegram. For support of other models from providers such as Anthropic, Gemini, Vertex AI, Azure, AWS, XAI, Cohere, Groq, Cloudflare, OpenRouter, etc., please use my other project, [uni-api](https:\u002F\u002Fgithub.com\u002Fyym68686\u002Funi-api), to integrate them. This helps reduce maintenance costs. Thank you for your understanding.\n\n## ✨ Features\n\n- **Multiple AI Models**: Supports APIs compatible with the OpenAI format. For other models from providers such as Anthropic, Gemini, Vertex AI, Azure, AWS, XAI, Cohere, Groq, Cloudflare, OpenRouter, etc., please integrate them using [uni-api](https:\u002F\u002Fgithub.com\u002Fyym68686\u002Funi-api). Also supports one-api\u002Fnew-api. Utilizes self-developed API to request backend [SDK](https:\u002F\u002Fgithub.com\u002Fyym68686\u002Faient), does not rely on OpenAI SDK.\n- **Multimodal Question Answering**: Supports question answering for voice, audio, images, and PDF\u002FTXT\u002FMD\u002Fpython documents. Users can directly upload files in the chat box for use.\n- **Model Grouping System**: Organize AI models into logical groups for easier selection. Models can be grouped by provider (GPT, Claude, etc.) or by capability. Models without an explicit group are automatically placed in an \"OTHERS\" group. This makes model selection more intuitive, especially when many models are available.\n- **Group Chat Topic Mode**: Supports enabling topic mode in group chats, isolating APIs, dialogue history, plugin configurations, and preferences between topics.\n- **Rich plugin system**: Supports web search (DuckDuckGo and Google), URL summarization, ArXiv paper summarization, and code interpreter.\n- **User-friendly interface**: Allows flexible switching of models within the chat window and supports streaming output similar to a typewriter effect. Supports precise Markdown message rendering, utilizing another of my [projects](https:\u002F\u002Fgithub.com\u002Fyym68686\u002Fmd2tgmd).\n- **Efficient Message Processing**: Asynchronously processes messages, answers questions in a multi-threaded manner, supports isolated dialogues, and provides unique dialogues for different users.\n- **Long Text Message Handling**: Automatically merges long text messages, breaking through Telegram's single message length limit. When the bot's response exceeds the Telegram limit, it will be split into multiple messages.\n- **Multi-user Dialogue Isolation**: Supports dialogue isolation and configuration isolation, allowing selection between multi-user and single-user modes.\n- **Question Prediction**: Automatically generates follow-up questions, anticipating what users might ask next.\n- **Multi-language Interface**: Supports Simplified Chinese, Traditional Chinese, Russian and English interfaces.\n- **Whitelist, Blacklist, and Admin Settings**: Supports setting up whitelists, blacklists, and administrators.\n- **Inline Mode**: Allows users to @ the bot in any chat window to generate answers without needing to ask questions in the bot's chat window.\n- **Convenient Deployment**: Supports one-click koyeb, Zeabur, Replit deployment with true zero cost and idiot-proof deployment process. It also supports kuma anti-sleep, as well as Docker and fly.io deployment.\n\n## 🍃 Environment variables\n\nThe following is a list of environment variables related to the bot's core settings:\n\n| Variable Name | Description | Required? |\n|---------------|-------------|-----------|\n| BOT_TOKEN | Telegram bot token. Create a bot on [BotFather](https:\u002F\u002Ft.me\u002FBotFather) to get the BOT_TOKEN. | **Yes** |\n| API_KEY | OpenAI or third-party API key. | **Yes** |\n| MODEL | Set the default QA model; the default is:`gpt-5`. This item can be freely switched using the bot's \"info\" command, and it doesn't need to be set in principle. | No |\n| WEB_HOOK | Whenever the telegram bot receives a user message, the message will be passed to WEB_HOOK, where the bot will listen to it and process the received messages in a timely manner. | No |\n| BASE_URL | If you are using the OpenAI official API, you don't need to set this. If you using a third-party API, you need to fill in the third-party proxy website. The default is: https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fchat\u002Fcompletions | No |\n| NICK | The default is empty, and NICK is the name of the bot. The bot will only respond when the message starts with NICK that the user inputs, otherwise the bot will respond to any message. Especially in group chats, if there is no NICK, the bot will reply to all messages. | No |\n| GOOGLE_API_KEY | If you need to use Google search, you need to set it. If you do not set this environment variable, the bot will default to provide duckduckgo search. | No |\n| GOOGLE_CSE_ID | If you need to use Google search, you need to set it together with GOOGLE_API_KEY. | No |\n| whitelist | Set which users can access the bot, and connect the user IDs authorized to use the bot with ','. The default value is `None`, which means that the bot is open to everyone. | No |\n| BLACK_LIST | Set which users are prohibited from accessing the bot, and connect the user IDs authorized to use the bot with ','. The default value is `None` | No |\n| ADMIN_LIST | Set up an admin list. Only admins can use the `\u002Finfo` command to configure the bot. | No |\n| GROUP_LIST | Set up a list of groups that can use the bot. Connect the group IDs with a comma (','). Even if group members are not on the whitelist, as long as the group ID is in the GROUP_LIST, all members of the group can use the bot. | No |\n| CUSTOM_MODELS | Set a list of custom model names. Use commas (',') to connect model names. If you need to remove a default model, add a hyphen (-) before the default model name. To remove all default models, use `-all`. To create model groups, use semicolons (';') to separate groups and use colon (':') to define group name with its models, e.g., `CUSTOM_MODELS=-all,command,grok-2;GPT:gpt-5,gpt-3.5-turbo;Claude:claude-3-opus,claude-3-sonnet;OTHERS`. Models without specific groups will be automatically placed in the \"OTHERS\" group. | No |\n| CHAT_MODE | Introduce multi-user mode, different users' configurations are not shared. When CHAT_MODE is `global`, all users share the configuration. When CHAT_MODE is `multiusers`, user configurations are independent of each other. | No |\n| temperature | Specify the temperature of the LLM. The default value is `0.5`. | No |\n| GET_MODELS | Specify whether to get supported models via API. Default is `False`. | No |\n| SYSTEMPROMPT | Specify system prompt, the system prompt is a string, for example: `SYSTEMPROMPT=You are ChatGPT, a large language model trained by OpenAI. Respond conversationally`. The default is `None`. The setting of the system prompt is only effective when `CHAT_MODE` is `global`. When `CHAT_MODE` is `multiusers`, the system prompt environment variable will not modify any user's system prompt regardless of its value, because users do not want their set system to be changed to a global system prompt. | No |\n| LANGUAGE | Specifies the default language displayed by the bot, including button display language and dialogue language. The default is `English`. Currently, it only supports setting to the following four languages: `English`, `Simplified Chinese`, `Traditional Chinese`, `Russian`. You can also use the `\u002Finfo` command to set the display language after the bot is deployed. | No |\n| CONFIG_DIR | Specify storage user profile folder. CONFIG_DIR is the folder for storing user configurations. Each time the bot starts, it reads the configurations from the CONFIG_DIR folder, so users won't lose their previous settings every time they restart. you can achieve configuration persistence by mounting folders using the `-v` parameter when deploying locally with Docker. Default is `user_configs`. | No |\n| RESET_TIME | Specifies how many seconds the bot resets the chat history. Every RESET_TIME seconds, the bot will reset the chat history for all users except the admin list. The reset time for each user is different, calculated based on the last question time of each user to determine the next reset time. It is not all users resetting at the same time. The default value is `3600` seconds, and the minimum value is `60` seconds. | No |\n\nThe following is a list of environment variables related to robot preferences. Preferences can also be set after the robot is started by using the `\u002Finfo` command and clicking the `Preferences` button:\n\n| Variable Name | Description | Required? |\n|---------------|-------------|-----------|\n| PASS_HISTORY | The default value is `9999`. The bot will remember the conversation history and consider the context in the next reply. If set to `0`, the bot will forget the conversation history and only consider the current conversation. The value of PASS_HISTORY must be greater than or equal to 0. It corresponds to the button named `Chat history` in the preferences. | No |\n| LONG_TEXT | If the length of the user's input message exceeds Telegram's limit and multiple messages are sent consecutively in a short period, the bot will treat these multiple messages as one. The default value is `True`. Corresponds to the button named `Long text merge` in the preferences. | No |\n| IMAGEQA | Enable image question answering, the default setting is that the model can answer image content, the default value is `True`. Corresponds to the button named `Image Q&A` in the preferences. | No |\n| LONG_TEXT_SPLIT | When the bot's reply exceeds Telegram's limit, it will be split into multiple messages. The default value is `True`. Corresponds to the button named `Long text split` in the preferences. | No |\n| FILE_UPLOAD_MESS | When a file or image upload is successful and the bot has finished processing, the bot will send a message indicating that the upload was successful. The default value is `True`. This corresponds to the button named `File uploaded message` in the preferences. | No |\n| FOLLOW_UP | Automatically generate multiple related questions for the user to choose from. The default value is `False`. Corresponds to the button named `Question suggestions` in the preferences. | No |\n| TITLE | Whether to display the model name at the beginning of the robot's reply. The default value is `False`. Corresponds to the button named `Model title` in the preferences. | No |\n| REPLY | Should the robot reply to the user's message in the \"reply\" format. The default value is `False`. Corresponds to the button named `Reply message` in the preferences. | No |\n\u003C!-- | TYPING | Whether to show \"typing\" status when the bot is replying. The default value is `False`. | No | -->\nThe following is a list of environment variables related to the bot's plugin settings:\n\n| Variable Name | Description | Required? |\n|---------------|-------------|-----------|\n| get_search_results | Whether to enable the search plugin. Default is `False`. | No |\n| get_url_content | Whether to enable the URL summarization plugin. Default is `False`. | No |\n| download_read_arxiv_pdf | Whether to enable the arXiv paper summarization plugin. Default is `False`. | No |\n| run_python_script | Whether to enable the code interpreter plugin. Default is `False`. | No |\n| generate_image | Whether to enable the image generation plugin. Default is `False`. | No |\n| get_time | Whether to enable the date plugin. Default is `False`. | No |\n\n\n## Fugue Remote Deployment\n\n### One-click deployment\n\nClick the button below to deploy the pre-built Docker image on Fugue with one click:\n\n[![Deploy to Fugue](https:\u002F\u002Fapi.fugue.pro\u002Fbutton.svg)](https:\u002F\u002Ffugue.pro\u002Fnew\u002Frepository?source-mode=docker-image&name=chatgpt&image-ref=docker.io%2Fyym68686%2Fchatgpt%3Alatest&env%5BAPI%5D=&env%5BBASE_URL%5D=&env%5BBOT_TOKEN%5D=)\n\nAfter opening the deploy page, fill in `BOT_TOKEN`, `API`, and `BASE_URL` in the environment editor, then deploy. `WEB_HOOK` is optional. If you already have a public domain for the app, set it to `https:\u002F\u002Fyour-domain\u002F`; otherwise, you can leave it blank.\n\n## Koyeb Remote Deployment\n\nThere are two ways to deploy on Koyeb, one is to use the one-click deployment with the Docker image provided by Koyeb, and the other is to import this repository for deployment. Both methods are free. The first method is simple to deploy but cannot update automatically, while the second method is slightly more complex but can update automatically.\n\n### One-click deployment\n\nClick the button below to automatically deploy using the pre-built Docker image with one click:\n\n[![Deploy to Koyeb](https:\u002F\u002Fwww.koyeb.com\u002Fstatic\u002Fimages\u002Fdeploy\u002Fbutton.svg)](https:\u002F\u002Fapp.koyeb.com\u002Fdeploy?name=chatgpt&type=docker&image=docker.io%2Fyym68686%2Fchatgpt%3Alatest&instance_type=free&regions=was&instances_min=0&autoscaling_sleep_idle_delay=300&env%5BAPI%5D=&env%5BBASE_URL%5D=&env%5BBOT_TOKEN%5D=&env%5BWEB_HOOK%5D=https%3A%2F%2F%7B%7B+KOYEB_PUBLIC_DOMAIN+%7D%7D%2F)\n\nIn the environment variables, fill in BOT_TOKEN, API, BASE_URL, and click the deploy button. WEB_HOOK environment variable can be left as is, and Koyeb will automatically assign a subdomain.\n\n### Repository deployment\n\n1. Fork this repository [Click to fork this repository](https:\u002F\u002Fgithub.com\u002Fyym68686\u002FChatGPT-Telegram-Bot\u002Ffork)\n\n2. When deploying, you need to choose the repository method, set `Run command` to `python3 bot.py`, and set `Exposed ports` to `8080`.\n\n3. [Install pull](https:\u002F\u002Fgithub.com\u002Fapps\u002Fpull) to automatically sync this repository.\n\n## Zeabur Remote Deployment\n\nOne-click deployment:\n\n[![Deploy on Zeabur](https:\u002F\u002Fzeabur.com\u002Fbutton.svg)](https:\u002F\u002Fzeabur.com\u002Ftemplates\u002FR5JY5O?referralCode=yym68686)\n\nIf you need follow-up function updates, the following deployment method is recommended:\n\n- Fork this repository first, then register for [Zeabur](https:\u002F\u002Fzeabur.com). Currently, Zeabur does not support free Docker container deployment. If you need to use Zeabur to deploy the bot for this project, you will need to upgrade to the Developer Plan. Fortunately, Zeabur has introduced their [sponsorship program](https:\u002F\u002Fzeabur.com\u002Fdocs\u002Fbilling\u002Fsponsor), which offers a one-month Developer Plan to all contributors of this project. If you have features you'd like to enhance, feel free to submit pull requests to this project.\n- Import from your own Github repository.\n- Set the required environment variables, and redeploy.\n- If you need function updates in the follow-up, just synchronize this repository in your own repository and redeploy in Zeabur to get the latest functions.\n\n## Replit Remote Deployment\n\n[![Run on Repl.it](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyym68686_ChatGPT-Telegram-Bot_readme_26e23a0dcf49.png)](https:\u002F\u002Freplit.com\u002Fnew\u002Fgithub\u002Fyym68686\u002FChatGPT-Telegram-Bot)\n\nAfter importing the Github repository, set the running command\n\n```bash\npip install -r requirements.txt > \u002Fdev\u002Fnull && python3 bot.py\n```\n\nSelect Secrets in the Tools sidebar, add the environment variables required by the bot, where:\n\n- WEB_HOOK: Replit will automatically assign a domain name to you, fill in `https:\u002F\u002Fappname.username.repl.co`\n- Remember to open \"Always On\"\n\nClick the run button on the top of the screen to run the bot.\n\n## fly.io Remote Deployment\n\nOfficial documentation: https:\u002F\u002Ffly.io\u002Fdocs\u002F\n\nUse Docker image to deploy fly.io application\n\n```bash\nflyctl launch --image yym68686\u002Fchatgpt:latest\n```\n\nEnter the name of the application when prompted, and select No for initializing Postgresql or Redis.\n\nFollow the prompts to deploy. A secondary domain name will be provided in the official control panel, which can be used to access the service.\n\nSet environment variables\n\n```bash\nflyctl secrets set BOT_TOKEN=bottoken\nflyctl secrets set API_KEY=\n# optional\nflyctl secrets set WEB_HOOK=https:\u002F\u002Fflyio-app-name.fly.dev\u002F\nflyctl secrets set NICK=javis\n```\n\nView all environment variables\n\n```bash\nflyctl secrets list\n```\n\nRemove environment variables\n\n```bash\nflyctl secrets unset MY_SECRET DATABASE_URL\n```\n\nssh to fly.io container\n\n```bash\nflyctl ssh issue --agent\n# ssh connection\nflyctl ssh establish\n```\n\nCheck whether the webhook URL is correct\n\n```bash\nhttps:\u002F\u002Fapi.telegram.org\u002Fbot\u003Ctoken>\u002FgetWebhookInfo\n```\n\n## Docker Local Deployment\n\nStart the container\n\n```bash\ndocker run -p 80:8080 --name chatbot -dit \\\n    -e BOT_TOKEN=your_telegram_bot_token \\\n    -e API_KEY= \\\n    -e BASE_URL= \\\n    -v .\u002Fuser_configs:\u002Fhome\u002Fuser_configs \\\n    yym68686\u002Fchatgpt:latest\n```\n\nOr if you want to use Docker Compose, here is a docker-compose.yml example:\n\n```yaml\nversion: \"3.5\"\nservices:\n  chatgptbot:\n    container_name: chatgptbot\n    image: yym68686\u002Fchatgpt:latest\n    environment:\n      - BOT_TOKEN=\n      - API_KEY=\n      - BASE_URL=\n      - CUSTOM_MODELS=-all;GPT:gpt-5,gpt-3.5-turbo;Claude:claude-3-opus,claude-3-sonnet\n    volumes:\n      - .\u002Fuser_configs:\u002Fhome\u002Fuser_configs\n    ports:\n      - 80:8080\n```\n\nRun Docker Compose container in the background\n\n```bash\ndocker-compose pull\ndocker-compose up -d\n\n# uni-api\ndocker-compose -f docker-compose-uni-api.yml up -d\n```\n\nPackage the Docker image in the repository and upload it to Docker Hub\n\n```bash\ndocker build --no-cache -t chatgpt:latest -f Dockerfile.build --platform linux\u002Famd64 .\ndocker tag chatgpt:latest yym68686\u002Fchatgpt:latest\ndocker push yym68686\u002Fchatgpt:latest\n```\n\nOne-Click Restart Docker Image\n\n```bash\nset -eu\ndocker pull yym68686\u002Fchatgpt:latest\ndocker rm -f chatbot\ndocker run -p 8080:8080 -dit --name chatbot \\\n-e BOT_TOKEN= \\\n-e API_KEY= \\\n-e BASE_URL= \\\n-e GOOGLE_API_KEY= \\\n-e GOOGLE_CSE_ID= \\\n-e claude_api_key= \\\n-v .\u002Fuser_configs:\u002Fhome\u002Fuser_configs \\\nyym68686\u002Fchatgpt:latest\ndocker logs -f chatbot\n```\n\nThis script is for restarting the Docker image with a single command. It first removes the existing Docker container named \"chatbot\" if it exists. Then, it runs a new Docker container with the name \"chatbot\", exposing port 8080 and setting various environment variables. The Docker image used is \"yym68686\u002Fchatgpt:latest\". Finally, it follows the logs of the \"chatbot\" container.\n\n## 🚀 Source code Local Deployment\n\npython >= 3.10\n\nRun the robot directly from the source code without using docker, Clone the repository:\n\n```bash\ngit clone --recurse-submodules --depth 1 -b main --quiet https:\u002F\u002Fgithub.com\u002Fyym68686\u002FChatGPT-Telegram-Bot.git\n```\n\nInstall Dependencies:\n\n```bash\npip install -r requirements.txt\n```\n\nConfigure Environment Variables:\n\n```bash\n.\u002Fconfigure_env.sh\n```\n\nRun:\n\n```bash\npython bot.py\n```\n\n## 🧩 Plugin\n\nThis project supports multiple plugins, including: DuckDuckGo and Google search, URL summary, ArXiv paper summary, DALLE-3 drawing, and code interpreter, etc. You can enable or disable these plugins by setting environment variables.\n\n- How to develop a plugin?\n\nAll the code related to plugins is in the git submodule aient within this repository. aient is an independent repository that I developed to handle API requests, conversation history management, and other functions. When you clone this repository using the `--recurse-submodules` parameter with git clone, aient will be automatically downloaded to your local machine. All the plugin code in this repository is located at the relative path `aient\u002Fsrc\u002Faient\u002Fplugins`. You can add your own plugin code in this directory. The plugin development process is as follows:\n\n1. Create a new Python file in the `aient\u002Fsrc\u002Faient\u002Fplugins` directory, for example, `myplugin.py`. Register the plugin by adding the `@register_tool()` decorator above your function. Import `register_tool` via `from .registry import register_tool`.\n\n2. Add translations for the plugin name in various languages in the utils\u002Fi18n.py file.\n\nAfter completing the above steps, your plugin is ready to use. 🎉\n\n## 📄 Frequently Asked Questions\n\n- What is the use of the WEB_HOOK environment variable? How should it be used?\n\nWEB_HOOK is a webhook address. Specifically, when a Telegram bot receives a user message, it sends the message to the Telegram server, which then forwards the message to the server at the WEB_HOOK address set by the bot. Therefore, when a message is sent to the bot, the bot executes the processing program almost immediately. Receiving messages via WEB_HOOK results in faster response times than when WEB_HOOK is not set.\n\nWhen deploying a bot using platforms like Zeabur, Replit, or Koyeb, these platforms provide you with a domain name that you need to fill in the WEB_HOOK, so the bot can receive user messages. Of course, not setting WEB_HOOK is also possible, but the bot's response time will be slightly longer, although the difference is not significant, so generally setting WEB_HOOK is not necessary.\n\nWhen deploying a bot on a server, you need to use reverse proxy tools like nginx or caddy to forward messages sent by the Telegram server to your server, so the bot can receive user messages. Therefore, you need to set WEB_HOOK to your server's domain name and forward the traffic requesting WEB_HOOK to the server and corresponding port where the bot is located. For example, in caddy, you can configure it like this in the caddy configuration file \u002Fetc\u002Fcaddy\u002FCaddyfile:\n\n```caddy\nyour_webhook_domain.com {\n    reverse_proxy localhost:8082\n}\n```\n\n- Why can't I use Google search?\n\nBy default, DuckDuckGo search is provided. The official API for Google search needs to be applied for by the user. It can provide real-time information that GPT could not answer before, such as today's trending topics on Weibo, today's weather in a specific location, and the progress of a certain person or news event.\n\n- Why can't I use the search function even though I added the Google search API?\n\nThere are two possibilities:\n\n1. Only large language model (LLM) APIs that support tool usage can use the search function. Currently, this project only supports the search function for APIs of the OpenAI, Claude, and Gemini series models. APIs from other model providers are not supported for tool usage in this project at the moment. If you have a model provider you wish to adapt, you can contact the maintainer.\n\n2. If you are using the APIs of OpenAI, Claude, and Gemini series models but cannot use the search function, it may be because the search function is not enabled. You can check whether the search function is enabled by clicking on preferences through the `\u002Finfo` command.\n\n3. If you are using the API of OpenAI, Claude, and Gemini series models, please ensure you are using the official API. If you are using a third-party relay API, the provider may be offering you the API through web scraping. APIs provided through web scraping cannot use tools use, meaning that all plugins of this project cannot be used. If you confirm that you are using the official API and still cannot search successfully, please contact the developer.\n\n- How do I switch models?\n\nYou can switch between GPT3.5\u002F4\u002F4o, and other models using the \"\u002Finfo\" command in the chat window.\n\n- Can it be deployed in a group?\n\nYes, it supports whitelist to prevent abuse and information leakage.\n\n- Why can't the bot talk when I add it to the group?\n\nIf this is the first time you add the bot to a group chat, you need to set the group privacy to disable in botfather, then remove the bot from the group chat and re-add it to use it normally.\n\nThe second method is to set the bot as an administrator, so the bot can be used normally. However, if you want to add the bot to a group chat where you are not an administrator, the first method is more suitable.\n\nAnother possibility is that the GROUP_LIST set is not the current group chat ID. Please check if GROUP_LIST is set; GROUP_LIST is the group ID, not the group name. The group ID starts with a minus sign followed by a string of numbers.\n\n- How do the settings of GROUP_LIST, ADMIN_LIST, and whitelist affect the behavior of the bot?\n\nIf whitelist is not set, everyone can use the bot. If whitelist is set, only users in the whitelist can use the bot. If GROUP_LIST is set, only groups in the GROUP_LIST can use the bot. If both whitelist and GROUP_LIST are set, everyone in the group can use the bot, but only users in the whitelist can privately chat with the bot. If ADMIN_LIST is set, only users in the ADMIN_LIST can use the \u002Finfo command to change the bot's settings. If ADMIN_LIST is not set, everyone can use the \u002Finfo command to change the bot's configuration. GROUP_LIST can also contain channels, channel IDs start with a minus sign followed by a string of numbers.\n\n- How should I set the BASE_URL?\n\nThe BASE_URL supports all suffixes, including: https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fchat\u002Fcompletions, https:\u002F\u002Fapi.openai.com\u002Fv1, and https:\u002F\u002Fapi.openai.com\u002F. The bot will automatically allocate different endpoints based on different uses.\n\n- Is it necessary to configure the web_hook environment variable?\n\nThe web_hook is not a mandatory environment variable. You only need to set the domain name (which must be consistent with WEB_HOOK) and other environment variables as required for your application's functionality.\n\n- I deployed a robot with docker compose. If the documentation is placed on the server locally, which directory should it be mounted to in order to take effect? Do I need to set additional configurations and modify the code?\n\nYou can directly send the documentation to the robot through the chat box, and the robot will automatically parse the documentation. To use the documentation dialogue function, you need to enable the historical conversation feature. There is no need for additional processing of the documentation.\n\n- I still can't get it to work... I want to use it in a group, I've set the ADMIN_LIST to myself, and the GROUP_LIST to that group, with the whitelist left empty. However, only I can use it in that group, other members in the group are prompted with no permission, what's going on?\n\nHere's a troubleshooting guide: Please carefully check if the GROUP_LIST is correct. The ID of a Telegram group starts with a negative sign followed by a series of numbers. If it's not, please use this bot [bot](https:\u002F\u002Ft.me\u002Fgetidsbot) to reacquire the group ID.\n\n- I've uploaded a document, but it's not responding based on the content of the document. What's going on?\n\nTo use the document question and answer feature, you must first enable the history record. You can turn on the history record through the `\u002Finfo` command, or by setting the environment variable `PASS_HISTORY` to be greater than to 2 to enable the history record by default. Please note that enabling the history record will incur additional costs, so this project does not enable the history record by default. This means that the question and answer feature cannot be used under the default settings. Before using this feature, you need to manually enable the history record.\n\n- After setting the `NICK`, there's no response when I @ the bot, and it only replies when the message starts with the nick. How can I make it respond to both the nick and @botname?\n\nIn a group chat scenario, if the environment variable `NICK` is not set, the bot will receive all group messages and respond to all of them. Therefore, it is necessary to set `NICK`. After setting `NICK`, the bot will only respond to messages that start with `NICK`. So, if you want to @ the bot to get a response, you just need to set NICK to @botname. This way, when you @ the bot in the group, the bot will detect that the message starts with @botname, and it will respond to the message.\n\n- How many messages will the history keep?\n\nAll other models use the official context length settings, for example, the `gpt-3.5-turbo-16k` context is 16k, the `gpt-5` context is 128k, and the `Claude3\u002F3.5` context is 200k. This limitation is implemented to save user costs, as most scenarios do not require a high context.\n\n- How to delete the default model name from the model list?\n\nYou can use the `CUSTOM_MODELS` environment variable to complete it. For example, if you want to add gpt-5 and remove the gpt-3.5 model from the model list, please set `CUSTOM_MODELS` to `gpt-5,-gpt-3.5`. If you want to delete all default models at once, you can set `CUSTOM_MODELS` to `-all,gpt-5`.\n\n- How do I organize models into groups?\n\nYou can use the `CUSTOM_MODELS` environment variable with a special syntax:\n1. Use semicolons (`;`) to separate groups\n2. Use a colon (`:`) to define a group name and its models\n3. List models within a group separated by commas (`,`)\n\nFor example:\n```\nCUSTOM_MODELS=-all;GPT:gpt-5,gpt-4,gpt-3.5-turbo;Claude:claude-3-opus,claude-3-sonnet,claude-3-haiku;Gemini:gemini-1.5-pro,gemini-1.0-pro;command,grok-2\n```\n\nThis creates three groups: \"GPT\", \"Claude\", and \"Gemini\", each containing their respective models. The models \"command\" and \"grok-2\" have no explicit group, so they'll automatically be placed in the \"OTHERS\" group.\n\nTo include an empty \"OTHERS\" group even if there are no ungrouped models, add \"OTHERS\" at the end:\n```\nCUSTOM_MODELS=-all;GPT:gpt-5;Claude:claude-3-opus;OTHERS\n```\n\n- How does conversation isolation specifically work?\n\nConversations are always isolated based on different windows, not different users. This means that within the same group chat window, the same topic, and the same private chat window, it is considered the same conversation. CHAT_MODE only affects whether configurations are isolated. In multi-user mode, each user's plugin configurations, preferences, etc., are independent and do not affect each other. In single-user mode, all users share the same plugin configurations and preferences. However, conversation history is always isolated. Conversation isolation is to protect user privacy, ensuring that users' conversation history, plugin configurations, preferences, etc., are not visible to other users.\n\n- Why hasn't the Docker image been updated for a long time?\n\nThe Docker image only stores the runtime environment of the program. Currently, the runtime environment of the program is stable, and the environment dependencies have hardly changed, so the Docker image has not been updated. Each time the Docker image is redeployed, it will pull the latest code, so there is no need to worry about the Docker image update issue.\n\n- Why does the container report an error \"http connect error or telegram.error.TimedOut: Timed out\" after starting?\n\nThis issue is likely caused by the server deploying Docker being unable to connect to the Telegram server or the instability of the Telegram server.\n\n1. In most cases, restarting the service, checking the server network environment, or waiting for the Telegram service to recover will suffice.\n2. Additionally, you might try communicating with the Telegram server via web hook, which might solve the problem.\n\n- How to make docker retry infinitely instead of stop at beginning?\n\nThe `--restart unless-stopped` parameter in Docker sets the container's restart policy. Specifically:\n\n1. unless-stopped: This policy means that the container will automatically restart if it stops, except when it is manually stopped. In other words, if the container stops due to an error or system reboot, it will automatically restart. However, if you manually stop the container (e.g., using the docker stop command), it will not restart on its own.\nThis parameter is particularly useful for services that need to run continuously, as it ensures that the service will automatically recover from unexpected interruptions without requiring manual intervention.\n\n2. Example: Suppose you have a Docker container running a web server, and you want it to restart automatically if it crashes or if the system reboots, but not if you manually stop it. You can use the following command:\n\n```shell\ndocker run -d --name my-web-server -p 80:80 --restart unless-stopped my-web-server-image\n```\nIn this example, the web server container named my-web-server will restart automatically unless you manually stop it.\n\n- Switching models, do I need to re-enter the prompt?\n\nYes, because switching models will reset the history, so you need to re-enter the prompt.\n\n- What is the appropriate value for PASS_HISTORY?\n\nThe number of PASS_HISTORY is strictly equal to the number of messages in the conversation history. The recommended value is 2, because the system prompt occupies one message count. If set to 0, PASS_HISTORY will automatically reset to 2 to ensure the conversation proceeds normally. When PASS_HISTORY is less than or equal to 2, the bot's behavior can be regarded as only remembering the current conversation, i.e., one question and one answer, and it will not remember the content of the previous Q&A next time. There is no limit to the maximum value of PASS_HISTORY, but please note that the more messages in the conversation history, the higher the cost of each conversation will be. When PASS_HISTORY is not set, the default value is 9999, indicating that the number of messages in the conversation history is 9999.\n\n- Can Bot tokens have multiple tokens?\n\nNo, in the future it will support multiple Bot Tokens.\n\n- How to use robot commands?\n\n1. `\u002Finfo`: The robot `\u002Finfo` command can view the robot's configuration information, including the current model in use, API URL, API key, etc. It can also change the robot's display language, preferences, and plugin settings.\n\n2. `\u002Fstart`: The robot `\u002Fstart` command can view the robot's usage instructions, usage methods, and function introduction. You can set the API key using the `\u002Fstart` command. If you have an official OpenAI API key, please use the following command: `\u002Fstart your_api_key`. If you are using a third-party API key, please use the following command: `\u002Fstart https:\u002F\u002Fyour_api_url your_api_key`.\n\n3. `\u002Freset`: The robot `\u002Freset` command can clear the robot's conversation messages and force the robot to stop generating replies. If you want to reset the system prompt, please use the following command: `\u002Freset your_system_prompt`. However, the `\u002Freset` command will never restore the robot's display language, preferences, plugin settings, model in use, API URL, API key, system prompt, etc.\n\n4. `\u002Fmodel`: The robot `\u002Fmodel` command allows you to quickly switch between AI models without going through the `\u002Finfo` menu. Simply use `\u002Fmodel model_name` to switch to a specific model. For example: `\u002Fmodel gpt-5` to switch to GPT-5 or `\u002Fmodel claude-3-opus` to switch to Claude 3 Opus. This command provides a faster way to change models during conversations.\n\n- What to do if Koyeb deployment fails?\n\nKoyeb's free service can be a bit unstable, so deployment failures are pretty common. You might want to try redeploying, and if that doesn't work, consider switching to another platform. 😊\n\n- Why does the default model name reappear after I use CUSTOM_MODELS to delete it, and then check again with the \u002Finfo command?\n\nIf you deployed using `docker-compose.yml`, do not add quotes around the value of `CUSTOM_MODELS`. Incorrect usage: `CUSTOM_MODELS=\"gpt-5,-gpt-3.5\"`, otherwise it will cause environment variable parsing errors, resulting in the default model name reappearing. The incorrect way will be parsed as deleting the `gpt-3.5\"` model, which will cause the default model name `gpt-3.5` not to be deleted. The correct way to write it is: `CUSTOM_MODELS=gpt-5,-gpt-3.5`.\n\nThe same applies to model groups. Incorrect: `CUSTOM_MODELS=\"GPT:gpt-5;Claude:claude-3-opus\"`. Correct: `CUSTOM_MODELS=GPT:gpt-5;Claude:claude-3-opus`. If your group names or model names contain special characters, be careful with escaping.\n\n- How can I use multiple API providers at the same time, for example, using both Gemini and OpenAI?\n\nThis project can only be configured with one API provider at a time. For example, if the `BASE_URL` is set to Gemini's API endpoint, you cannot use OpenAI's API simultaneously. To use multiple providers at the same time, you must use the `uni-api` project. `uni-api` can convert various API formats from different providers into the standard OpenAI format. Since this project exclusively supports the OpenAI API format, using `uni-api` allows you to use models from dozens of different providers simultaneously. It is important to note that \"OpenAI format\" does not mean you can only use OpenAI's models; many other providers (like Gemini, Groq, Cloudflare, etc.) also support being called via an OpenAI-compatible API format.\n\n- Why did you change the whole foundation of the api key, now i cant have grok and gemini without changing the api?\n\nThe developer deleted APIs other than the OpenAI format. Currently, if you want to use other formats of APIs, you must convert them to the OpenAI format through the developer's other project, uni-api. You can configure dozens of different providers to use in the tg bot at the same time through uni-api. The purpose of this is to reduce maintenance costs, as the developer only needs to maintain uni-api to adapt to all the latest features. Of course, gemini officially supports OpenAI format endpoints, for example: `https:\u002F\u002Fgenerativelanguage.googleapis.com\u002Fv1\u002Fchat\u002Fcompletions`.\n\n## References\n\nhttps:\u002F\u002Fcore.telegram.org\u002Fbots\u002Fapi\n\nhttps:\u002F\u002Fgithub.com\u002Facheong08\u002FChatGPT\n\nhttps:\u002F\u002Fgithub.com\u002Ffranalgaba\u002Fchatgpt-telegram-bot-serverless\n\nhttps:\u002F\u002Fgithub.com\u002Fgpchelkin\u002Fscdlbot\u002Fblob\u002Fd64d14f6c6d357ba818e80b8a0a9291c2146d6fe\u002Fscdlbot\u002F__main__.py#L8\n\nThe markdown rendering of the message used is another [project](https:\u002F\u002Fgithub.com\u002Fyym68686\u002Fmd2tgmd) of mine.\n\nduckduckgo AI: https:\u002F\u002Fgithub.com\u002Fmrgick\u002Fduck_chat\n\n## Sponsors\n\nWe are grateful for the support from the following sponsors:\n\u003C!-- $300+$380+¥1200+¥300+$30+$25+$20+¥50 -->\n- @fasizhuanqian: 300 USDT\n\n- @ZETA: $380\n\n- @yuerbujin: ¥1200\n\n- @RR5AM: ¥300\n\n- @IKUNONHK: 30 USDT\n\n- @miya0v0: 30 USDT\n\n- [@Zeabur](https:\u002F\u002Fzeabur.com?referralCode=yym68686&utm_source=yym68686&utm_campaign=oss): $25\n\n- @Bill_ZKE: 20 USDT\n\n- @wagon_look: ¥50\n\n\u003C!-- [![Deployed on Zeabur](https:\u002F\u002Fzeabur.com\u002Fdeployed-on-zeabur-dark.svg)](https:\u002F\u002Fzeabur.com?referralCode=yym68686&utm_source=yym68686&utm_campaign=oss) -->\n\n## How to Sponsor Us\n\nIf you would like to support our project, you can sponsor us through the following methods:\n\n1. [PayPal](https:\u002F\u002Fwww.paypal.me\u002Fyym68686)\n\n2. [USDT-TRC20](https:\u002F\u002Fpb.yym68686.top\u002F~USDT-TRC20), USDT-TRC20 Wallet Address: `TLFbqSv5pDu5he43mVmK1dNx7yBMFeN7d8`\n\n3. [WeChat](https:\u002F\u002Fpb.yym68686.top\u002F~wechat)\n\n4. [Alipay](https:\u002F\u002Fpb.yym68686.top\u002F~alipay)\n\nThank you for your support!\n\n## Star History\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fyym68686\u002FChatGPT-Telegram-Bot\u002Fstargazers\">\n        \u003Cimg width=\"500\" alt=\"Star History Chart\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyym68686_ChatGPT-Telegram-Bot_readme_619ed827b2ef.png\">\n\u003C\u002Fa>\n\n## License\n\nThis project is licensed under GPLv3, which means you are free to copy, distribute, and modify the software, as long as all modifications and derivative works are also released under the same license.\n","\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyym68686_ChatGPT-Telegram-Bot_readme_35000cfa7343.jpg\">\n\u003C\u002Fp>\n\n# 🤖️ 电报聊天机器人\n\n[English](README.md) | [Chinese](README_CN.md)\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Ft.me\u002F+_01cz9tAkUc1YzZl\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FJoin Telegram Group-blue?&logo=telegram\">\n  \u003C\u002Fa>\n  \u003Ca href=\"https:\u002F\u002Ft.me\u002Fchatgpt68_bot\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FTelegram Bot-grey?&logo=Probot\">\n  \u003C\u002Fa>\n   \u003Ca href=\"https:\u002F\u002Fhub.docker.com\u002Frepository\u002Fdocker\u002Fyym68686\u002Fchatgpt\">\n    \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fdocker\u002Fpulls\u002Fyym68686\u002Fchatgpt?color=blue\" alt=\"docker pull\">\n  \u003C\u002Fa>\n\u003C\u002Fp>\n\nChatGPT 电报机器人是一款功能强大的电报机器人，支持与 OpenAI 兼容的大语言模型 API。它使用户能够在电报上进行高效的对话和信息检索。对于 Anthropic、Gemini、Vertex AI、Azure、AWS、XAI、Cohere、Groq、Cloudflare、OpenRouter 等其他提供商的模型支持，请使用我的另一个项目 [uni-api](https:\u002F\u002Fgithub.com\u002Fyym68686\u002Funi-api) 来集成它们。这有助于降低维护成本。感谢您的理解。\n\n## ✨ 功能\n\n- **多种 AI 模型**：支持与 OpenAI 格式兼容的 API。对于 Anthropic、Gemini、Vertex AI、Azure、AWS、XAI、Cohere、Groq、Cloudflare、OpenRouter 等其他提供商的模型，请使用 [uni-api](https:\u002F\u002Fgithub.com\u002Fyym68686\u002Funi-api) 进行集成。同时也支持 one-api\u002Fnew-api。采用自主研发的 API 请求后端 [SDK](https:\u002F\u002Fgithub.com\u002Fyym68686\u002Faient)，不依赖于 OpenAI SDK。\n- **多模态问答**：支持语音、音频、图片以及 PDF\u002FTXT\u002FMD\u002FPython 文档的问答。用户可以直接在聊天框中上传文件以供使用。\n- **模型分组系统**：将 AI 模型按逻辑分组，便于选择。模型可以按提供商（如 GPT、Claude 等）或按能力分组。未明确分组的模型会自动归入“OTHERS”组。这使得模型选择更加直观，尤其是在可用模型较多时。\n- **群聊主题模式**：支持在群聊中启用主题模式，实现不同主题之间的 API、对话历史、插件配置及偏好设置的隔离。\n- **丰富的插件系统**：支持网络搜索（DuckDuckGo 和 Google）、URL 摘要、ArXiv 论文摘要以及代码解释器。\n- **用户友好的界面**：允许在聊天窗口内灵活切换模型，并支持类似打字机效果的流式输出。支持精确的 Markdown 消息渲染，利用了我的另一个 [项目](https:\u002F\u002Fgithub.com\u002Fyym68686\u002Fmd2tgmd)。\n- **高效的消息处理**：异步处理消息，多线程回答问题，支持对话隔离，为不同用户提供独立的对话记录。\n- **长文本消息处理**：自动合并长文本消息，突破电报单条消息长度限制。当机器人的回复超过电报限制时，会将其拆分为多条消息。\n- **多用户对话隔离**：支持对话隔离和配置隔离，允许在多用户模式和单用户模式之间切换。\n- **问题预测**：自动生成后续问题，预测用户接下来可能提出的问题。\n- **多语言界面**：支持简体中文、繁体中文、俄语和英语界面。\n- **白名单、黑名单和管理员设置**：支持设置白名单、黑名单和管理员。\n- **内联模式**：允许用户在任何聊天窗口中 @ 机器人来生成答案，而无需在机器人的聊天窗口中提问。\n- **便捷部署**：支持一键 koyeb、Zeabur、Replit 部署，真正零成本且傻瓜式操作。同时支持 kuma 防休眠，以及 Docker 和 fly.io 部署。\n\n## 🍃 环境变量\n\n以下是与机器人核心设置相关的环境变量列表：\n\n| 变量名 | 描述 | 是否必填 |\n|---------------|-------------|-----------|\n| BOT_TOKEN | Telegram 机器人令牌。在 [BotFather](https:\u002F\u002Ft.me\u002FBotFather) 上创建一个机器人以获取 BOT_TOKEN。 | **是** |\n| API_KEY | OpenAI 或第三方 API 密钥。 | **是** |\n| MODEL | 设置默认的问答模型；默认值为：`gpt-5`。此选项可通过机器人的“info”命令自由切换，原则上无需设置。 | 否 |\n| WEB_HOOK | 每当 Telegram 机器人接收到用户消息时，消息会被传递到 WEB_HOOK，机器人将在那里监听并及时处理接收到的消息。 | 否 |\n| BASE_URL | 如果您使用的是 OpenAI 官方 API，则无需设置此参数。如果您使用的是第三方 API，则需要填写第三方代理网站。默认值为：https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fchat\u002Fcompletions | 否 |\n| NICK | 默认为空，NICK 是机器人的名称。只有当用户输入的消息以 NICK 开头时，机器人才会响应；否则，机器人会对任何消息作出回应。尤其是在群聊中，如果没有设置 NICK，机器人会回复所有消息。 | 否 |\n| GOOGLE_API_KEY | 如果需要使用 Google 搜索，必须设置此参数。如果不设置该环境变量，机器人将默认提供 DuckDuckGo 搜索服务。 | 否 |\n| GOOGLE_CSE_ID | 如果需要使用 Google 搜索，需与 GOOGLE_API_KEY 一起设置。 | 否 |\n| whitelist | 设置哪些用户可以访问机器人，并用逗号（`,`）连接获准使用机器人的用户 ID。默认值为 `None`，表示机器人对所有人开放。 | 否 |\n| BLACK_LIST | 设置哪些用户被禁止访问机器人，并用逗号（`,`）连接被禁止使用的用户 ID。默认值为 `None`。 | 否 |\n| ADMIN_LIST | 设置管理员列表。只有管理员可以使用 `\u002Finfo` 命令来配置机器人。 | 否 |\n| GROUP_LIST | 设置可以使用机器人的群组列表。用逗号（`,`）连接群组 ID。即使群组成员不在白名单中，只要群组 ID 在 GROUP_LIST 中，该群组的所有成员都可以使用机器人。 | 否 |\n| CUSTOM_MODELS | 设置自定义模型名称列表。用逗号（`,`）连接模型名称。如果需要移除某个默认模型，在默认模型名称前加一个连字符（`-`）。要移除所有默认模型，使用 `-all`。要创建模型分组，用分号（`;`）分隔不同分组，用冒号（`:`）定义分组名称及其包含的模型，例如：`CUSTOM_MODELS=-all,command,grok-2;GPT:gpt-5,gpt-3.5-turbo;Claude:claude-3-opus,claude-3-sonnet;OTHERS`。未指定分组的模型将自动归入“OTHERS”分组。 | 否 |\n| CHAT_MODE | 引入多用户模式，不同用户的配置互不共享。当 CHAT_MODE 为 `global` 时，所有用户共享同一配置。当 CHAT_MODE 为 `multiusers` 时，用户的配置彼此独立。 | 否 |\n| temperature | 指定大语言模型的温度。默认值为 `0.5`。 | 否 |\n| GET_MODELS | 指定是否通过 API 获取支持的模型。默认值为 `False`。 | 否 |\n| SYSTEMPROMPT | 指定系统提示语，系统提示语是一个字符串，例如：`SYSTEMPROMPT=你是 ChatGPT，由 OpenAI 训练的大语言模型。请以对话方式回答问题。`。默认值为 `None`。系统提示语的设置仅在 `CHAT_MODE` 为 `global` 时有效。当 `CHAT_MODE` 为 `multiusers` 时，无论系统提示语的值如何，该环境变量都不会修改任何用户的系统提示语，因为用户不希望自己的系统提示语被更改为全局系统提示语。 | 否 |\n| LANGUAGE | 指定机器人显示的默认语言，包括按钮显示语言和对话语言。默认值为 `English`。目前仅支持以下四种语言的设置：`English`、`Simplified Chinese`、`Traditional Chinese`、`Russian`。部署完成后，也可以使用 `\u002Finfo` 命令来设置显示语言。 | 否 |\n| CONFIG_DIR | 指定存储用户配置文件的文件夹路径。CONFIG_DIR 是用于存储用户配置的文件夹。每次机器人启动时，都会从 CONFIG_DIR 文件夹中读取配置，因此用户每次重启后都不会丢失之前的设置。在本地使用 Docker 部署时，可以通过 `-v` 参数挂载文件夹来实现配置持久化。默认值为 `user_configs`。 | 否 |\n| RESET_TIME | 指定机器人重置聊天记录的时间间隔。每隔 RESET_TIME 秒，机器人会为除管理员列表以外的所有用户重置聊天记录。每个用户的重置时间不同，根据其上次提问的时间计算下一次重置时间，因此并非所有用户同时重置。默认值为 `3600` 秒，最小值为 `60` 秒。 | 否 |\n\n以下是与机器人偏好设置相关的环境变量列表。机器人启动后，也可以通过使用 `\u002Finfo` 命令并点击“Preferences”按钮来设置偏好：\n\n| 变量名称 | 描述 | 是否必填 |\n|---------------|-------------|-----------|\n| PASS_HISTORY | 默认值为 `9999`。机器人会记住对话历史，并在下一次回复时考虑上下文。如果设置为 `0`，机器人将忘记对话历史，仅考虑当前对话。PASS_HISTORY 的值必须大于或等于 0。它对应于偏好设置中的“聊天历史”按钮。 | 否 |\n| LONG_TEXT | 如果用户输入的消息长度超过 Telegram 的限制，并且在短时间内连续发送多条消息，机器人会将这些消息视为一条消息处理。默认值为 `True`。对应于偏好设置中的“长文本合并”按钮。 | 否 |\n| IMAGEQA | 启用图像问答功能，默认设置为模型可以回答图像内容，即默认值为 `True`。对应于偏好设置中的“图像问答”按钮。 | 否 |\n| LONG_TEXT_SPLIT | 当机器人的回复超过 Telegram 的限制时，会将其拆分为多条消息。默认值为 `True`。对应于偏好设置中的“长文本拆分”按钮。 | 否 |\n| FILE_UPLOAD_MESS | 当文件或图片上传成功且机器人完成处理后，机器人会发送一条消息提示上传成功。默认值为 `True`。这对应于偏好设置中的“文件上传消息”按钮。 | 否 |\n| FOLLOW_UP | 自动为用户生成多个相关问题供其选择。默认值为 `False`。对应于偏好设置中的“问题建议”按钮。 | 否 |\n| TITLE | 是否在机器人回复的开头显示模型名称。默认值为 `False`。对应于偏好设置中的“模型标题”按钮。 | 否 |\n| REPLY | 机器人是否应以“回复”格式回复用户的消息。默认值为 `False`。对应于偏好设置中的“回复消息”按钮。 | 否 |\n\u003C!-- | TYPING | 机器人回复时是否显示“正在输入”状态。默认值为 `False`。 | 否 | -->\n以下是与机器人插件设置相关的环境变量列表：\n\n| 变量名称 | 描述 | 是否必填 |\n|---------------|-------------|-----------|\n| get_search_results | 是否启用搜索插件。默认为 `False`。 | 否 |\n| get_url_content | 是否启用 URL 摘要插件。默认为 `False`。 | 否 |\n| download_read_arxiv_pdf | 是否启用 arXiv 论文摘要插件。默认为 `False`。 | 否 |\n| run_python_script | 是否启用代码解释器插件。默认为 `False`。 | 否 |\n| generate_image | 是否启用图像生成插件。默认为 `False`。 | 否 |\n| get_time | 是否启用日期插件。默认为 `False`。 | 否 |\n\n\n\n\n## Fugue 远程部署\n\n### 一键部署\n\n点击下方按钮，即可在 Fugue 上使用预构建的 Docker 镜像进行一键部署：\n\n[![Deploy to Fugue](https:\u002F\u002Fapi.fugue.pro\u002Fbutton.svg)](https:\u002F\u002Ffugue.pro\u002Fnew\u002Frepository?source-mode=docker-image&name=chatgpt&image-ref=docker.io%2Fyym68686%2Fchatgpt%3Alatest&env%5BAPI%5D=&env%5BBASE_URL%5D=&env%5BBOT_TOKEN%5D=)\n\n打开部署页面后，在环境编辑器中填写 `BOT_TOKEN`、`API` 和 `BASE_URL`，然后进行部署。`WEB_HOOK` 是可选的。如果你已经为应用拥有公共域名，则将其设置为 `https:\u002F\u002Fyour-domain\u002F`；否则，可以留空。\n\n## Koyeb 远程部署\n\n在 Koyeb 上有两种部署方式：一种是使用 Koyeb 提供的 Docker 镜像进行一键部署，另一种是导入本仓库进行部署。这两种方法都是免费的。第一种方法部署简单，但无法自动更新；而第二种方法稍显复杂，却可以实现自动更新。\n\n### 一键部署\n\n点击下方按钮，即可使用预构建的 Docker 镜像进行一键自动部署：\n\n[![Deploy to Koyeb](https:\u002F\u002Fwww.koyeb.com\u002Fstatic\u002Fimages\u002Fdeploy\u002Fbutton.svg)](https:\u002F\u002Fapp.koyeb.com\u002Fdeploy?name=chatgpt&type=docker&image=docker.io%2Fyym68686%2Fchatgpt%3Alatest&instance_type=free&regions=was&instances_min=0&autoscaling_sleep_idle_delay=300&env%5BAPI%5D=&env%5BBASE_URL%5D=&env%5BBOT_TOKEN%5D=&env%5BWEB_HOOK%5D=https%3A%2F%2F%7B%7B+KOYEB_PUBLIC_DOMAIN+%7D%7D%2F)\n\n在环境变量中，填写 BOT_TOKEN、API 和 BASE_URL，然后点击部署按钮。WEB_HOOK 环境变量可以保持原样，Koyeb 会自动分配一个子域名。\n\n### 仓库部署\n\n1. 分叉本仓库 [点击分叉此仓库](https:\u002F\u002Fgithub.com\u002Fyym68686\u002FChatGPT-Telegram-Bot\u002Ffork)\n\n2. 部署时，需选择仓库方式，将 `Run command` 设置为 `python3 bot.py`，并将 `Exposed ports` 设置为 `8080`。\n\n3. 安装 [pull 请求](https:\u002F\u002Fgithub.com\u002Fapps\u002Fpull)，以便自动同步本仓库。\n\n## Zeabur 远程部署\n\n一键部署：\n\n[![Deploy on Zeabur](https:\u002F\u002Fzeabur.com\u002Fbutton.svg)](https:\u002F\u002Fzeabur.com\u002Ftemplates\u002FR5JY5O?referralCode=yym68686)\n\n若需要后续功能更新，建议采用以下部署方式：\n\n- 首先分叉本仓库，然后注册 [Zeabur](https:\u002F\u002Fzeabur.com)。目前，Zeabur 不支持免费的 Docker 容器部署。若需使用 Zeabur 部署该项目的机器人，需升级至 Developer Plan。幸运的是，Zeabur 推出了他们的 [赞助计划](https:\u002F\u002Fzeabur.com\u002Fdocs\u002Fbilling\u002Fsponsor)，为本项目的每一位贡献者提供一个月的 Developer Plan。如果你有想要增强的功能，欢迎向本项目提交 pull 请求。\n- 从你自己的 Github 仓库导入。\n- 设置所需的环境变量，并重新部署。\n- 若后续需要功能更新，只需在你的仓库中同步本仓库，然后在 Zeabur 上重新部署，即可获得最新功能。\n\n## Replit 远程部署\n\n[![Run on Repl.it](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyym68686_ChatGPT-Telegram-Bot_readme_26e23a0dcf49.png)](https:\u002F\u002Freplit.com\u002Fnew\u002Fgithub\u002Fyym68686\u002FChatGPT-Telegram-Bot)\n\n导入 Github 仓库后，设置运行命令：\n\n```bash\npip install -r requirements.txt > \u002Fdev\u002Fnull && python3 bot.py\n```\n\n在工具栏的 Secrets 中添加机器人所需的环境变量，其中：\n\n- WEB_HOOK：Replit 会自动为你分配一个域名，填写 `https:\u002F\u002Fappname.username.repl.co`\n- 请记得开启“Always On”\n\n点击屏幕顶部的运行按钮即可启动机器人。\n\n## fly.io 远程部署\n\n官方文档：https:\u002F\u002Ffly.io\u002Fdocs\u002F\n\n使用 Docker 镜像部署 fly.io 应用程序\n\n```bash\nflyctl launch --image yym68686\u002Fchatgpt:latest\n```\n\n在提示时输入应用程序名称，并选择“否”以不初始化 Postgresql 或 Redis。\n\n按照提示进行部署。官方控制面板中会提供一个二级域名，可用于访问服务。\n\n设置环境变量\n\n```bash\nflyctl secrets set BOT_TOKEN=bottoken\nflyctl secrets set API_KEY=\n# 可选\nflyctl secrets set WEB_HOOK=https:\u002F\u002Fflyio-app-name.fly.dev\u002F\nflyctl secrets set NICK=javis\n```\n\n查看所有环境变量\n\n```bash\nflyctl secrets list\n```\n\n移除环境变量\n\n```bash\nflyctl secrets unset MY_SECRET DATABASE_URL\n```\n\n通过 SSH 连接到 fly.io 容器\n\n```bash\nflyctl ssh issue --agent\n# 建立 SSH 连接\nflyctl ssh establish\n```\n\n检查 Webhook URL 是否正确\n\n```bash\nhttps:\u002F\u002Fapi.telegram.org\u002Fbot\u003Ctoken>\u002FgetWebhookInfo\n```\n\n## Docker 本地部署\n\n启动容器\n\n```bash\ndocker run -p 80:8080 --name chatbot -dit \\\n    -e BOT_TOKEN=your_telegram_bot_token \\\n    -e API_KEY= \\\n    -e BASE_URL= \\\n    -v .\u002Fuser_configs:\u002Fhome\u002Fuser_configs \\\n    yym68686\u002Fchatgpt:latest\n```\n\n或者，如果您想使用 Docker Compose，以下是 docker-compose.yml 示例：\n\n```yaml\nversion: \"3.5\"\nservices:\n  chatgptbot:\n    container_name: chatgptbot\n    image: yym68686\u002Fchatgpt:latest\n    environment:\n      - BOT_TOKEN=\n      - API_KEY=\n      - BASE_URL=\n      - CUSTOM_MODELS=-all;GPT:gpt-5,gpt-3.5-turbo;Claude:claude-3-opus,claude-3-sonnet\n    volumes:\n      - .\u002Fuser_configs:\u002Fhome\u002Fuser_configs\n    ports:\n      - 80:8080\n```\n\n在后台运行 Docker Compose 容器\n\n```bash\ndocker-compose pull\ndocker-compose up -d\n\n# uni-api\ndocker-compose -f docker-compose-uni-api.yml up -d\n```\n\n将 Docker 镜像打包并上传到 Docker Hub\n\n```bash\ndocker build --no-cache -t chatgpt:latest -f Dockerfile.build --platform linux\u002Famd64 .\ndocker tag chatgpt:latest yym68686\u002Fchatgpt:latest\ndocker push yym68686\u002Fchatgpt:latest\n```\n\n一键重启 Docker 镜像\n\n```bash\nset -eu\ndocker pull yym68686\u002Fchatgpt:latest\ndocker rm -f chatbot\ndocker run -p 8080:8080 -dit --name chatbot \\\n-e BOT_TOKEN= \\\n-e API_KEY= \\\n-e BASE_URL= \\\n-e GOOGLE_API_KEY= \\\n-e GOOGLE_CSE_ID= \\\n-e claude_api_key= \\\n-v .\u002Fuser_configs:\u002Fhome\u002Fuser_configs \\\nyym68686\u002Fchatgpt:latest\ndocker logs -f chatbot\n```\n\n此脚本用于通过单个命令重启 Docker 镜像。首先，如果存在名为“chatbot”的现有 Docker 容器，则将其删除。然后，运行一个新的名为“chatbot”的 Docker 容器，暴露 8080 端口，并设置各种环境变量。使用的 Docker 镜像是“yym68686\u002Fchatgpt:latest”。最后，跟踪“chatbot”容器的日志。\n\n## 🚀 源代码本地部署\n\nPython >= 3.10\n\n直接从源代码运行机器人，无需使用 Docker。克隆仓库：\n\n```bash\ngit clone --recurse-submodules --depth 1 -b main --quiet https:\u002F\u002Fgithub.com\u002Fyym68686\u002FChatGPT-Telegram-Bot.git\n```\n\n安装依赖项：\n\n```bash\npip install -r requirements.txt\n```\n\n配置环境变量：\n\n```bash\n.\u002Fconfigure_env.sh\n```\n\n运行：\n\n```bash\npython bot.py\n```\n\n## 🧩 插件\n\n该项目支持多种插件，包括：DuckDuckGo 和 Google 搜索、URL 摘要、ArXiv 论文摘要、DALLE-3 绘画以及代码解释器等。您可以通过设置环境变量来启用或禁用这些插件。\n\n- 如何开发插件？\n\n所有与插件相关的代码都位于该仓库中的 git 子模块 aient 中。aient 是我独立开发的一个仓库，用于处理 API 请求、对话历史管理等功能。当您使用带有 `--recurse-submodules` 参数的 git clone 克隆此仓库时，aient 将自动下载到您的本地机器上。此仓库中的所有插件代码都位于相对路径 `aient\u002Fsrc\u002Faient\u002Fplugins` 下。您可以在此目录中添加自己的插件代码。插件开发流程如下：\n\n1. 在 `aient\u002Fsrc\u002Faient\u002Fplugins` 目录下创建一个新的 Python 文件，例如 `myplugin.py`。通过在函数上方添加 `@register_tool()` 装饰器来注册插件。通过 `from .registry import register_tool` 导入 `register_tool`。\n\n2. 在 utils\u002Fi18n.py 文件中为插件名称添加多种语言的翻译。\n\n完成上述步骤后，您的插件即可使用。🎉\n\n## 📄 常见问题解答\n\n- WEB_HOOK 环境变量有什么作用？应该如何使用？\n\nWEB_HOOK 是一个 webhook 地址。具体来说，当 Telegram 机器人收到用户消息时，它会将消息发送到 Telegram 服务器，然后由服务器将消息转发到机器人设置的 WEB_HOOK 地址处的服务器。因此，当有消息发送到机器人时，机器人几乎会立即执行处理程序。通过 WEB_HOOK 接收消息比未设置 WEB_HOOK 时响应速度更快。\n\n在使用 Zeabur、Replit 或 Koyeb 等平台部署机器人时，这些平台会为您提供一个域名，您需要将其填写到 WEB_HOOK 中，以便机器人能够接收用户消息。当然，也可以不设置 WEB_HOOK，但机器人的响应时间会稍长一些，尽管差异并不明显，因此通常不需要设置 WEB_HOOK。\n\n在服务器上部署机器人时，您需要使用 nginx 或 caddy 等反向代理工具，将 Telegram 服务器发送的消息转发到您的服务器，以便机器人能够接收用户消息。因此，您需要将 WEB_HOOK 设置为您服务器的域名，并将请求 WEB_HOOK 的流量转发到机器人所在的服务器和相应端口。例如，在 caddy 中，您可以在 caddy 配置文件 \u002Fetc\u002Fcaddy\u002FCaddyfile 中这样配置：\n\n```caddy\nyour_webhook_domain.com {\n    reverse_proxy localhost:8082\n}\n```\n\n- 为什么我无法使用 Google 搜索？\n\n默认情况下提供的是 DuckDuckGo 搜索。Google 搜索的官方 API 需要用户自行申请。它可以提供 GPT 之前无法回答的实时信息，例如微博上的今日热点、特定地点的今日天气，以及某个人物或新闻事件的进展。\n\n- 为什么即使我添加了 Google 搜索 API，仍然无法使用搜索功能？\n\n可能有两种原因：\n\n1. 只有支持工具使用的大型语言模型（LLM）API 才能使用搜索功能。目前，此项目仅支持 OpenAI、Claude 和 Gemini 系列模型的 API 使用搜索功能。其他模型提供商的 API 目前在此项目中不支持工具使用。如果您希望适配某个模型提供商，可以联系维护者。\n\n2. 如果您正在使用 OpenAI、Claude 和 Gemini 系列模型的 API，但无法使用搜索功能，可能是因为搜索功能尚未启用。您可以通过 `\u002Finfo` 命令进入设置界面，检查是否已开启搜索功能。\n\n3. 如果您使用的是 OpenAI、Claude 或 Gemini 系列模型的 API，请确保您使用的是官方 API。如果您使用的是第三方中继 API，提供商可能是通过网页爬取的方式为您提供 API。而通过网页爬取提供的 API 无法使用工具功能，这意味着本项目的所有插件都无法使用。如果您确认自己使用的是官方 API 但仍无法成功搜索，请联系开发者。\n\n- 如何切换模型？\n\n您可以在聊天窗口中使用 `\u002Finfo` 命令在 GPT-3.5、GPT-4、GPT-4o 等不同模型之间进行切换。\n\n- 能否部署到群组中？\n\n可以。该机器人支持白名单机制，以防止滥用和信息泄露。\n\n- 为什么将机器人添加到群组后无法正常对话？\n\n如果这是您首次将机器人加入群聊，您需要在 BotFather 中将群组隐私设置为“禁用”，然后将机器人从群聊中移除并重新添加，这样机器人就能正常使用了。\n\n另一种方法是将机器人设为管理员，这样它就可以正常工作。然而，如果您想将机器人添加到一个您不是管理员的群聊中，第一种方法更为合适。\n\n另外一种可能性是 `GROUP_LIST` 设置的并非当前群聊的 ID。请检查是否已正确设置 `GROUP_LIST`。需要注意的是，`GROUP_LIST` 是指群组的 ID，而不是群组名称。群组 ID 以负号开头，后跟一串数字。\n\n- `GROUP_LIST`、`ADMIN_LIST` 和白名单的设置如何影响机器人的行为？\n\n如果未设置白名单，所有人都可以使用机器人。若设置了白名单，则只有白名单中的用户才能使用机器人。如果设置了 `GROUP_LIST`，则只有 `GROUP_LIST` 中的群组可以使用机器人。如果同时设置了白名单和 `GROUP_LIST`，那么群组内的所有人都可以使用机器人，但只有白名单中的用户可以与机器人进行私聊。如果设置了 `ADMIN_LIST`，则只有 `ADMIN_LIST` 中的用户可以使用 `\u002Finfo` 命令来更改机器人的设置。如果没有设置 `ADMIN_LIST`，则所有人都可以使用 `\u002Finfo` 命令来修改机器人的配置。此外，`GROUP_LIST` 也可以包含频道，频道 ID 同样以负号开头，后接一串数字。\n\n- `BASE_URL` 应该如何设置？\n\n`BASE_URL` 支持所有后缀，包括：https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fchat\u002Fcompletions、https:\u002F\u002Fapi.openai.com\u002Fv1 和 https:\u002F\u002Fapi.openai.com\u002F。机器人会根据不同的用途自动分配不同的端点。\n\n- 是否必须配置 `web_hook` 环境变量？\n\n`web_hook` 并非必需的环境变量。您只需根据应用功能需求，设置域名（需与 `WEB_HOOK` 一致）及其他必要的环境变量即可。\n\n- 我使用 Docker Compose 部署了机器人。如果文档存储在服务器本地，应将其挂载到哪个目录才能生效？是否需要额外配置或修改代码？\n\n您可以直接通过聊天框将文档发送给机器人，机器人会自动解析文档内容。要使用文档问答功能，您需要先启用历史对话功能。无需对文档进行额外处理。\n\n- 我仍然无法让机器人正常工作……我想在群组中使用它，已经将 `ADMIN_LIST` 设置为自己，`GROUP_LIST` 设置为该群组，白名单保持为空。然而，只有我可以在该群组中使用机器人，其他成员却提示没有权限，这是怎么回事？\n\n以下是排查步骤：请仔细检查 `GROUP_LIST` 是否正确。Telegram 群组的 ID 以负号开头，后接一串数字。如果不正确，请使用此机器人 [bot](https:\u002F\u002Ft.me\u002Fgetidsbot) 重新获取群组 ID。\n\n- 我上传了文档，但机器人并未根据文档内容作出响应，这是为什么？\n\n要使用文档问答功能，您必须先启用历史记录功能。您可以通过 `\u002Finfo` 命令开启历史记录，或者将环境变量 `PASS_HISTORY` 设置为大于 2 的值，以默认启用历史记录功能。请注意，启用历史记录会产生额外费用，因此本项目默认不启用历史记录功能。这意味着在默认设置下，问答功能无法使用。在使用此功能前，您需要手动开启历史记录功能。\n\n- 设置了 `NICK` 后，当我使用 @ 提及机器人时没有反应，只有当消息以昵称开头时才会回复。如何让机器人既能响应昵称，也能响应 @机器人名呢？\n\n在群聊场景下，如果未设置环境变量 `NICK`，机器人会接收所有群组消息并作出回应。因此，设置 `NICK` 是必要的。设置 `NICK` 后，机器人只会对以 `NICK` 开头的消息作出响应。所以，如果您希望使用 @ 提及机器人时获得回复，只需将 `NICK` 设置为 @机器人名即可。这样一来，当您在群组中 @ 机器人时，机器人会检测到消息以 @机器人名开头，并作出相应回复。\n\n- 历史记录会保留多少条消息？\n\n其他所有模型均采用官方设定的上下文长度限制，例如 `gpt-3.5-turbo-16k` 的上下文长度为 16,000 token，`gpt-5` 的上下文长度为 128,000 token，而 `Claude3\u002F3.5` 的上下文长度为 200,000 token。这一限制是为了节省用户的成本，因为大多数场景并不需要过高的上下文长度。\n\n- 如何从模型列表中删除默认的模型名称？\n\n您可以使用 `CUSTOM_MODELS` 环境变量来实现。例如，如果您想添加 gpt-5 并从模型列表中移除 gpt-3.5，可以将 `CUSTOM_MODELS` 设置为 `gpt-5,-gpt-3.5`。如果您想一次性删除所有默认模型，可以将 `CUSTOM_MODELS` 设置为 `-all,gpt-5`。\n\n- 如何将模型分组？\n\n您可以使用带有特殊语法的 `CUSTOM_MODELS` 环境变量：\n\n1. 使用分号 (`;`) 分隔不同的组；\n2. 使用冒号 (`:`) 定义组名及其包含的模型；\n3. 在同一组内，使用逗号 (`,`) 分隔各个模型。\n\n例如：\n```\nCUSTOM_MODELS=-all;GPT:gpt-5,gpt-4,gpt-3.5-turbo;Claude:claude-3-opus,claude-3-sonnet,claude-3-haiku;Gemini:gemini-1.5-pro,gemini-1.0-pro;command,grok-2\n```\n\n这将创建三个组：“GPT”、“Claude”和“Gemini”，每个组分别包含相应的模型。“command”和“grok-2”没有明确归属的组，因此它们会被自动归入“OTHERS”组。\n\n如果即使没有未分组的模型也想包含一个空的“OTHERS”组，可以在最后添加“OTHERS”：\n```\nCUSTOM_MODELS=-all;GPT:gpt-5;Claude:claude-3-opus;OTHERS\n```\n\n- 对话隔离具体是如何工作的？\n\n对话始终是基于不同的窗口而非不同用户进行隔离的。这意味着在同一群聊窗口、同一主题以及同一私聊窗口中，都被视为同一个对话。CHAT_MODE 只影响配置是否被隔离。在多用户模式下，每个用户的插件配置、偏好设置等都是独立的，互不影响。而在单用户模式下，所有用户共享相同的插件配置和偏好设置。然而，对话历史始终是隔离的。对话隔离是为了保护用户隐私，确保用户的对话历史、插件配置、偏好设置等不会被其他用户看到。\n\n- 为什么 Docker 镜像很久没有更新了？\n\nDocker 镜像仅存储程序的运行环境。目前程序的运行环境非常稳定，环境依赖几乎没有变化，因此 Docker 镜像并未更新。每次重新部署 Docker 镜像时，都会拉取最新的代码，所以无需担心 Docker 镜像的更新问题。\n\n- 为什么容器启动后会报错“http connect error 或 telegram.error.TimedOut: Timed out”？\n\n这个问题很可能是由于部署 Docker 的服务器无法连接到 Telegram 服务器，或者 Telegram 服务器本身不稳定导致的。\n\n1. 大多数情况下，只需重启服务、检查服务器网络环境，或等待 Telegram 服务恢复即可。\n2. 此外，您也可以尝试通过 Webhook 与 Telegram 服务器通信，这可能会解决问题。\n\n- 如何让 Docker 容器无限重试而不是一开始就停止？\n\nDocker 中的 `--restart unless-stopped` 参数用于设置容器的重启策略。具体来说：\n\n1. unless-stopped：该策略表示容器会在停止时自动重启，除非它是被手动停止的。也就是说，如果容器因错误或系统重启而停止，它会自动重启；但如果您手动停止容器（例如使用 `docker stop` 命令），它将不会自行重启。\n这个参数对于需要持续运行的服务非常有用，因为它可以确保服务在意外中断后自动恢复，而无需人工干预。\n\n2. 示例：假设您有一个运行 Web 服务器的 Docker 容器，并希望它在崩溃或系统重启时自动重启，但在您手动停止时则不重启。您可以使用以下命令：\n\n```shell\ndocker run -d --name my-web-server -p 80:80 --restart unless-stopped my-web-server-image\n```\n在这个例子中，名为 my-web-server 的 Web 服务器容器将在除手动停止以外的情况下自动重启。\n\n- 切换模型时，我需要重新输入提示词吗？\n\n是的，因为切换模型会重置对话历史，所以需要重新输入提示词。\n\n- PASS_HISTORY 的合适值是多少？\n\nPASS_HISTORY 的数值严格等于对话历史中的消息数量。推荐值为 2，因为系统提示词占一条消息。如果设置为 0，PASS_HISTORY 会自动重置为 2，以确保对话正常进行。当 PASS_HISTORY 小于或等于 2 时，机器人只会记住当前的一问一答，下次不会再记住之前的问答内容。PASS_HISTORY 的最大值没有限制，但请注意，对话历史中的消息越多，每次对话的成本就越高。如果没有设置 PASS_HISTORY，其默认值为 9999，表示对话历史中的消息数为 9999 条。\n\n- Bot Token 是否可以有多个？\n\n目前还不支持多个 Bot Token，未来会支持。\n\n- 如何使用机器人指令？\n\n1. `\u002Finfo`：机器人 `\u002Finfo` 指令可以查看机器人的配置信息，包括当前使用的模型、API 地址、API 密钥等。还可以更改机器人的显示语言、偏好设置以及插件配置。\n\n2. `\u002Fstart`：机器人 `\u002Fstart` 指令可以查看机器人的使用说明、使用方法和功能介绍。您可以通过 `\u002Fstart` 指令设置 API 密钥。如果您有官方的 OpenAI API 密钥，请使用以下命令：`\u002Fstart your_api_key`。如果您使用的是第三方 API 密钥，请使用以下命令：`\u002Fstart https:\u002F\u002Fyour_api_url your_api_key`。\n\n3. `\u002Freset`：机器人 `\u002Freset` 指令可以清除机器人的对话记录，并强制机器人停止生成回复。如果您想重置系统提示词，请使用以下命令：`\u002Freset your_system_prompt`。但是，`\u002Freset` 指令不会恢复机器人的显示语言、偏好设置、插件配置、使用的模型、API 地址、API 密钥、系统提示词等。\n\n4. `\u002Fmodel`：机器人 `\u002Fmodel` 指令允许您快速切换 AI 模型，而无需通过 `\u002Finfo` 菜单。只需使用 `\u002Fmodel model_name` 即可切换到特定模型。例如：`\u002Fmodel gpt-5` 切换到 GPT-5，或 `\u002Fmodel claude-3-opus` 切换到 Claude 3 Opus。此命令为对话过程中快速更换模型提供了更便捷的方式。\n\n- 如果 Koyeb 部署失败怎么办？\n\nKoyeb 的免费服务有时会有些不稳定，因此部署失败的情况比较常见。您可以尝试重新部署，如果仍然不行，可以考虑切换到其他平台。😊\n\n- 为什么我使用 CUSTOM_MODELS 删除某个模型后，再次用 \u002Finfo 命令查看时，默认模型名称又出现了？\n\n如果您使用 `docker-compose.yml` 进行部署，请不要在 `CUSTOM_MODELS` 的值周围添加引号。错误用法：`CUSTOM_MODELS=\"gpt-5,-gpt-3.5\"`，否则会导致环境变量解析错误，从而使得默认模型名称重新出现。错误写法会被解析为删除 `gpt-3.5` 模型，因此默认的 `gpt-3.5` 模型并不会被删除。正确的写法是：`CUSTOM_MODELS=gpt-5,-gpt-3.5`。\n\n同样的规则也适用于模型分组。错误：`CUSTOM_MODELS=\"GPT:gpt-5;Claude:claude-3-opus\"`。正确：`CUSTOM_MODELS=GPT:gpt-5;Claude:claude-3-opus`。如果您的分组名称或模型名称包含特殊字符，请注意转义处理。\n\n- 我如何同时使用多个 API 提供商？例如，同时使用 Gemini 和 OpenAI？\n\n该项目一次只能配置一个 API 提供商。例如，如果将 `BASE_URL` 设置为 Gemini 的 API 端点，则无法同时使用 OpenAI 的 API。若需同时使用多个提供商，必须采用 `uni-api` 项目。`uni-api` 可以将不同提供商的各种 API 格式转换为标准的 OpenAI 格式。由于本项目仅支持 OpenAI API 格式，因此通过 `uni-api` 可以同时使用来自数十家不同提供商的模型。需要注意的是，“OpenAI 格式”并不意味着只能使用 OpenAI 的模型；许多其他提供商（如 Gemini、Groq、Cloudflare 等）也支持通过与 OpenAI 兼容的 API 格式进行调用。\n\n- 为什么你们改变了 API 密钥的整体基础？现在如果不更换 API，我就无法同时使用 Grok 和 Gemini 了？\n\n开发者删除了除 OpenAI 格式之外的其他 API。目前，若要使用其他格式的 API，必须通过开发者的另一个项目 `uni-api` 将其转换为 OpenAI 格式。借助 `uni-api`, 您可以同时在 Telegram 机器人中配置并使用数十家不同的提供商。这样做的目的是降低维护成本，因为开发者只需维护 `uni-api` 即可适配所有最新功能。当然，Gemini 官方也支持 OpenAI 格式的端点，例如：`https:\u002F\u002Fgenerativelanguage.googleapis.com\u002Fv1\u002Fchat\u002Fcompletions`。\n\n\n\n## 参考资料\n\nhttps:\u002F\u002Fcore.telegram.org\u002Fbots\u002Fapi\n\nhttps:\u002F\u002Fgithub.com\u002Facheong08\u002FChatGPT\n\nhttps:\u002F\u002Fgithub.com\u002Ffranalgaba\u002Fchatgpt-telegram-bot-serverless\n\nhttps:\u002F\u002Fgithub.com\u002Fgpchelkin\u002Fscdlbot\u002Fblob\u002Fd64d14f6c6d357ba818e80b8a0a9291c2146d6fe\u002Fscdlbot\u002F__main__.py#L8\n\n该消息所使用的 Markdown 渲染是我另一个项目 [md2tgmd](https:\u002F\u002Fgithub.com\u002Fyym68686\u002Fmd2tgmd)。\n\nDuckDuckGo AI：https:\u002F\u002Fgithub.com\u002Fmrgick\u002Fduck_chat\n\n## 赞助商\n\n我们感谢以下赞助商的支持：\n\u003C!-- $300+$380+¥1200+¥300+$30+$25+$20+¥50 -->\n- @fasizhuanqian：300 USDT\n\n- @ZETA：$380\n\n- @yuerbujin：¥1200\n\n- @RR5AM：¥300\n\n- @IKUNONHK：30 USDT\n\n- @miya0v0：30 USDT\n\n- [@Zeabur](https:\u002F\u002Fzeabur.com?referralCode=yym68686&utm_source=yym68686&utm_campaign=oss)：$25\n\n- @Bill_ZKE：20 USDT\n\n- @wagon_look：¥50\n\n\u003C!-- [![Deployed on Zeabur](https:\u002F\u002Fzeabur.com\u002Fdeployed-on-zeabur-dark.svg)](https:\u002F\u002Fzeabur.com?referralCode=yym68686&utm_source=yym68686&utm_campaign=oss) -->\n\n## 如何赞助我们\n\n如果您希望支持我们的项目，可以通过以下方式赞助：\n\n1. [PayPal](https:\u002F\u002Fwww.paypal.me\u002Fyym68686)\n\n2. [USDT-TRC20](https:\u002F\u002Fpb.yym68686.top\u002F~USDT-TRC20)，USDT-TRC20 钱包地址：`TLFbqSv5pDu5he43mVmK1dNx7yBMFeN7d8`\n\n3. [微信](https:\u002F\u002Fpb.yym68686.top\u002F~wechat)\n\n4. [支付宝](https:\u002F\u002Fpb.yym68686.top\u002F~alipay)\n\n感谢您的支持！\n\n## 星标历史\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fyym68686\u002FChatGPT-Telegram-Bot\u002Fstargazers\">\n        \u003Cimg width=\"500\" alt=\"星标历史图表\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyym68686_ChatGPT-Telegram-Bot_readme_619ed827b2ef.png\">\n\u003C\u002Fa>\n\n## 许可证\n\n本项目采用 GPLv3 许可证，这意味着您可以自由地复制、分发和修改该软件，但前提是所有修改及衍生作品也必须以相同许可证发布。","# ChatGPT-Telegram-Bot 快速上手指南\n\n## 环境准备\n\n在部署前，请确保你拥有以下环境和凭证：\n\n*   **运行环境**：支持 Docker 的服务器（推荐），或 Python 3.9+ 环境。\n*   **Telegram Bot Token**：\n    1.  在 Telegram 中搜索并打开 [@BotFather](https:\u002F\u002Ft.me\u002FBotFather)。\n    2.  发送 `\u002Fnewbot` 创建新机器人。\n    3.  按提示设置名称和用户名，获取最终的 `BOT_TOKEN`。\n*   **大模型 API Key**：\n    *   OpenAI 官方 Key，或兼容 OpenAI 格式的第三方 API Key（如 One-API、New-API 等）。\n    *   若需使用 Claude、Gemini 等其他模型，建议先通过 [uni-api](https:\u002F\u002Fgithub.com\u002Fyym68686\u002Funi-api) 进行统一接入。\n\n## 安装步骤\n\n推荐使用 **Docker** 进行一键部署，最简单且易于维护。\n\n### 方法一：Docker 部署（推荐）\n\n1.  **拉取镜像**\n    ```bash\n    docker pull yym68686\u002Fchatgpt:latest\n    ```\n\n2.  **启动容器**\n    将下方的 `YOUR_BOT_TOKEN` 和 `YOUR_API_KEY` 替换为你的实际凭证。如需持久化配置用户数据，可挂载 `user_configs` 目录。\n\n    ```bash\n    docker run -d \\\n      --name chatgpt-bot \\\n      -e BOT_TOKEN=\"YOUR_BOT_TOKEN\" \\\n      -e API_KEY=\"YOUR_API_KEY\" \\\n      -e MODEL=\"gpt-4o\" \\\n      -v $(pwd)\u002Fuser_configs:\u002Fapp\u002Fuser_configs \\\n      --restart always \\\n      yym68686\u002Fchatgpt:latest\n    ```\n\n    > **国内加速提示**：如果拉取 Docker 镜像速度慢，建议使用国内镜像加速器（如阿里云、腾讯云容器镜像服务）配置 Docker Daemon 后重试。\n\n### 方法二：无服务器部署（零成本方案）\n\n项目支持一键部署到以下平台，适合个人免费试用：\n*   **Koyeb \u002F Zeabur \u002F Replit**：直接导入 GitHub 仓库，在环境变量设置中填入 `BOT_TOKEN` 和 `API_KEY` 即可启动。\n*   **Fly.io**：需安装 `flyctl` 命令行工具进行部署。\n\n## 基本使用\n\n部署成功后，无需重启即可通过 Telegram 客户端进行配置和使用。\n\n### 1. 启动对话\n在 Telegram 中搜索你设置的机器人用户名，点击 **Start** 或发送 `\u002Fstart`。\n\n### 2. 核心功能体验\n*   **日常问答**：直接发送文字消息，机器人将流式返回答案。\n*   **多模态交互**：直接发送**图片**、**语音**、**PDF\u002FTXT\u002FMD\u002FPython 文件**，机器人会自动解析内容并回答相关问题。\n*   **切换模型**：发送 `\u002Finfo` 命令，点击弹出的按钮即可在不同模型组（如 GPT, Claude 等）之间切换。\n*   **插件使用**：\n    *   **联网搜索**：发送包含链接的消息或直接提问最新事件（需在环境变量开启 `get_search_results=True` 或通过 `\u002Finfo` -> `Preferences` 开启）。\n    *   **代码解释器**：发送数学问题或数据处理需求，机器人会自动编写并执行 Python 代码。\n\n### 3. 群聊集成\n*   将机器人邀请至群组。\n*   **默认行为**：机器人会回复群内所有消息。\n*   **指定回复**：设置环境变量 `NICK`（例如 `NICK=@MyBot`），机器人仅当消息以该昵称开头时才回复。\n*   **话题模式**：在支持 Topic 的群组中，机器人可隔离不同话题的对话历史和配置。\n\n### 4. 高级配置（可选）\n如需修改默认行为（如白名单、系统提示词、搜索插件开关等），请在启动命令的 `-e` 参数中添加相应环境变量，或在运行后通过 `\u002Finfo` -> `Preferences` 图形化界面动态调整。\n\n例如，仅允许特定用户访问：\n```bash\n-e whitelist=\"123456789,987654321\"\n```\n*(注：用户 ID 可通过向 @userinfobot 发送消息获取)*","某跨国技术团队的日常运营中，成员需频繁在 Telegram 群组内协作，既要实时查询最新的技术文档和论文，又要处理多语言沟通及代码调试问题。\n\n### 没有 ChatGPT-Telegram-Bot 时\n- **信息获取割裂**：成员需跳出聊天窗口，手动打开浏览器搜索新闻或查阅 ArXiv 论文，再复制粘贴回群组，严重打断协作流。\n- **多模型切换繁琐**：团队想对比不同大模型（如 Claude 与 GPT）的回答，必须分别登录多个网页端账号，无法在同一界面快速切换。\n- **文件处理低效**：上传 PDF 技术手册或代码截图后，无法直接获得解析结果，只能人工阅读提炼后再打字总结。\n- **长文本与上下文混乱**：Telegram 原生消息长度限制导致长篇代码或报告被截断，且群聊中不同成员的提问容易混淆，缺乏独立的对话隔离。\n\n### 使用 ChatGPT-Telegram-Bot 后\n- **一站式智能检索**：直接在对话框输入指令即可调用 Web Search 或总结 ArXiv 论文，插件自动返回带来源的精炼答案，无需离开 Telegram。\n- **模型分组随心换**：利用模型分组系统，成员可在聊天窗口内一键切换 GPT、Gemini 或 Groq 等后端，即时对比不同模型的输出效果。\n- **多模态直接问答**：直接拖入 PDF 文档、语音条或代码截图，ChatGPT-Telegram-Bot 立即解析内容并给出针对性解答或代码修复建议。\n- **话题隔离与长文无忧**：开启群组话题模式后，不同项目的讨论互不干扰；超长回复自动拆分发送，完美突破字符限制，确保信息完整流畅。\n\nChatGPT-Telegram-Bot 将分散的 AI 能力无缝融入即时通讯流，把原本碎片化的“搜索 - 复制 - 粘贴”工作流转变为高效的“提问 - 获取”闭环。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fyym68686_ChatGPT-Telegram-Bot_0dd00086.png","yym68686","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fyym68686_e581d80c.jpg","A minimalist. Code is law.","ZJU","Hangzhou China","yym68686@outlook.com","https:\u002F\u002Fyym68686.top","https:\u002F\u002Fgithub.com\u002Fyym68686",[81,85,89],{"name":82,"color":83,"percentage":84},"Python","#3572A5",73.6,{"name":86,"color":87,"percentage":88},"Scala","#c22d40",26.4,{"name":90,"color":91,"percentage":92},"Dockerfile","#384d54",0,1234,394,"2026-04-06T13:57:09","GPL-3.0","Linux, macOS, Windows","未说明",{"notes":100,"python":98,"dependencies":101},"该工具是一个调用远程 API 的 Telegram 机器人，本地运行无需 GPU 和高内存。支持通过 Docker、Koyeb、Zeabur、Replit 或 fly.io 部署。核心功能依赖环境变量配置（如 BOT_TOKEN 和 API_KEY）。若需使用 Google 搜索插件需额外配置 GOOGLE_API_KEY 和 GOOGLE_CSE_ID。",[102,103,104],"Docker (可选)","Telegram Bot API","OpenAI-compatible API",[106,35,13,14],"插件",[108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126],"chatgpt","docker","fly-io","python-telegram-bot","telegram-bot","replit","replit-bot","zeabur","agent","langchain","gpt-4-api","claude","claude-api","claude-3-opus","groq","mixtral-8x7b","gemini","koyeb","vertex-ai",null,"2026-03-27T02:49:30.150509","2026-04-07T04:00:28.449172",[131,136,141,146,151,156],{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},20892,"使用 DALL-E 生成图片时提示\"Invalid URL\"或 404 错误怎么办？","这是因为 Docker 环境变量中未正确配置 API_URL。请在 docker-compose.yml 的环境变量部分添加：`API_URL=https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fchat\u002Fcompletions`。添加后重启容器即可解决该问题。","https:\u002F\u002Fgithub.com\u002Fyym68686\u002FChatGPT-Telegram-Bot\u002Fissues\u002F108",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},20893,"为什么我的 API 报错不支持 gpt-4-vision-preview 模型？","这是因为您使用的第三方转发接口不支持 gpt-4-vision-preview 模型特有的数组格式（content 为列表），只支持普通文本格式。解决方法是修改代码：打开 bot.py 文件，注释掉第 83 行代码，强制让程序使用普通文本格式发送请求，即可兼容不支持 Vision 格式的接口。","https:\u002F\u002Fgithub.com\u002Fyym68686\u002FChatGPT-Telegram-Bot\u002Fissues\u002F27",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},20894,"如何对机器人中的众多模型进行分组管理，方便查找？","可以通过配置环境变量 `CUSTOM_MODELS` 来实现模型分组。语法格式为：使用分号 `;` 分隔不同组，冒号 `:` 前为组名，冒号后为该组下的模型列表（逗号分隔）。例如：`CUSTOM_MODELS=-all,command,grok-2;OPENAI:o3-mini,gpt-4o;ANTHROPIC:claude-3`。未明确分组的模型将自动归类为\"OTHERS\"组。配置后在机器人中选择模型时会显示分组按钮。","https:\u002F\u002Fgithub.com\u002Fyym68686\u002FChatGPT-Telegram-Bot\u002Fissues\u002F63",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},20895,"Flux 等模型生成的图片链接没有后缀名导致无法解析或显示怎么办？","如果图片 URL 不以扩展名结尾导致机器人无法识别，可以使用 `wsrv.nl` 服务进行修复。将原始链接（如 `https:\u002F\u002Fexample.com\u002Fimage`）改写为 `https:\u002F\u002Fwsrv.nl\u002F?url=[URL_escaped]&output=jpg` 格式。其中 `[URL_escaped]` 是经过 URL 编码的原始图片地址。这可以强制添加图片后缀并解决解析问题。也可以自行部署 wsrv 服务。","https:\u002F\u002Fgithub.com\u002Fyym68686\u002FChatGPT-Telegram-Bot\u002Fissues\u002F67",{"id":152,"question_zh":153,"answer_zh":154,"source_url":155},20896,"Gemini 模型回复只有一个单词并抛出整数错误如何解决？","该问题可能是由构建缓存导致的异常。尝试重新部署项目并清除构建缓存（wiping the build cache）通常可以解决此问题。如果问题依旧，请检查 System Instruction 是否过长或包含特殊字符导致模型响应异常。","https:\u002F\u002Fgithub.com\u002Fyym68686\u002FChatGPT-Telegram-Bot\u002Fissues\u002F91",{"id":157,"question_zh":158,"answer_zh":159,"source_url":145},20897,"如何自定义机器人显示的模型列表，隐藏不需要的模型？","通过设置环境变量 `CUSTOM_MODELS` 可以精确控制显示的模型。使用 `-all` 表示默认不显示任何模型，然后显式列出需要显示的模型或模型组。例如：`CUSTOM_MODELS=-all,gpt-4o,claude-3` 将只显示这两个模型。结合分组功能，可以更灵活地管理模型列表。",[]]