{"id":13559332,"url":"https://github.com/Quan666/ELFChatBot","last_synced_at":"2025-04-03T14:31:54.723Z","repository":{"id":52927844,"uuid":"322523154","full_name":"Quan666/ELFChatBot","owner":"Quan666","description":"闲聊QQ机器人，也就是人工智障","archived":true,"fork":false,"pushed_at":"2023-03-15T09:55:24.000Z","size":127,"stargazers_count":100,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-05T19:04:02.052Z","etag":null,"topics":["baidu","chatgpt","cqhttp","cqhttp-mirai","nonebot2","python","qq","qqbot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Quan666.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}},"created_at":"2020-12-18T07:36:21.000Z","updated_at":"2025-02-12T02:53:54.000Z","dependencies_parsed_at":"2024-01-14T02:54:22.046Z","dependency_job_id":"d777919c-8f07-4233-97d3-baf74c0151e9","html_url":"https://github.com/Quan666/ELFChatBot","commit_stats":{"total_commits":70,"total_committers":5,"mean_commits":14.0,"dds":0.4285714285714286,"last_synced_commit":"5d5f2b6ccc5fdb696f23b928e23c1869b17a8024"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quan666%2FELFChatBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quan666%2FELFChatBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quan666%2FELFChatBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Quan666%2FELFChatBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Quan666","download_url":"https://codeload.github.com/Quan666/ELFChatBot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247018541,"owners_count":20870017,"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":["baidu","chatgpt","cqhttp","cqhttp-mirai","nonebot2","python","qq","qqbot"],"created_at":"2024-08-01T13:00:18.727Z","updated_at":"2025-04-03T14:31:54.439Z","avatar_url":"https://github.com/Quan666.png","language":"Python","readme":"# ELFChatBot\n\n\n\u003e **这是一个闲聊机器人，基于 [Nonebot2](https://v2.nonebot.dev/guide/)**  \n\u003e **接入了腾讯和百度的闲聊 api，百度的api支持连续对话**  \n\u003e **可以实现群聊、私聊，同时随机回复群聊消息。**  \n\u003e **支持 ChatGPT **  \n\n效果图：\n\n![image-20210114125523902](https://cdn.jsdelivr.net/gh/Quan666/CDN/pic/image-20210114125523902.png)\n\n## 使用\n\n私聊或群里 @bot 即可触发聊天，结束回复设定的关键词即可\n\nChatGPT： 发送 `chatgpt` 命令触发\n\n## 娱乐功能\n  1. 随机回复群友消息\n  2. 伪造转发合并消息（fake、fakes触发，具体使用看代码）\n\n## 申请密钥\n\n1. 百度大脑平台\n\n   https://ai.baidu.com/unit/home 注册并创建机器人，设置好机器人技能（至少包含闲聊），得到机器人id（S开头）、`api_key`、`secret_key`\n\n   注意：默认优先使用百度\n   \n   \n2. ~~腾讯开放平台（推荐作为备用也申请一个）~~ 失效了\n\n   ~~前往 [https://ai.qq.com/console/capability/detail/8](https://ai.qq.com/console/capability/detail/8) 注册并创建应用，并在能力库接入 智能闲聊，得到 `app_id` 以及 `app_key`~~\n\n\n3. 注册 openai （推荐使用！）\n   \n   OpenAI: [https://chat.openai.com/chat](https://chat.openai.com/chat)\n\n   创建 api key\n   \n   国内服务器需要以下步骤二选一：\n\n    1. 使用 cloudflare 反代 chat.openai.com ，将 `chatgpt_cf_proxy.js` 文件内代码复制部署到 cloudflare workers 并配置自定义域名，将域名填入如 `chatgpt_host=https://chatgpt.iy.ci`\n\n    2. 配置代理(e: chat_proxy=\"127.0.0.1:7890\")\n\n   使用： \n    \n    私聊发送 chatgpt_api_key 设置 api key(仅仅自己使用)\n    \n    私聊发送 chatgpt_api_key_admin 设置全局 api key (所有人都可使用)\n    \n    发送 `chatgpt 问题` 即可，在群组需要在前面 @机器人\n    \n    支持以下指令: \n    #预设 (预设指令，例如扮演猫娘) 、\n    #重试 (重新回答) 、\n    #刷新 (重置上下文) 、\n\n## 部署\n\n**注意：Python 3.8+**\n\n\n1. 下载代码到本地\n\n2. 参照 [ELF_RSS 2.0的部署方式](https://github.com/Quan666/ELF_RSS/tree/2.0) \n\n3. 运行 `pip install -r requirements.txt` \n\n4. 请按照 注释 修改配置文件 （文件 `.env.prod` ）\n\n5. 运行 `nb run`\n\n6. 收到机器人发送的启动成功消息\n\n\n#### 已经部署过其它 Nonebot2 机器人\n\n1. 下载 项目文件夹 `src/plugins/ELFChatBot` 复制 到你部署好了的机器人 `plugins` 目录\n2. 下载 `requirements.txt` 文件，并运行 `pip install -r requirements.txt` \n3. 同 `第一次部署` 一样，修改配置文件\n4. 运行 `nb run`\n\n","funding_links":[],"categories":["应用案例"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FQuan666%2FELFChatBot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FQuan666%2FELFChatBot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FQuan666%2FELFChatBot/lists"}