{"id":48446501,"url":"https://github.com/sky22333/qqbot","last_synced_at":"2026-04-06T18:03:39.449Z","repository":{"id":345041067,"uuid":"1184101159","full_name":"sky22333/qqbot","owner":"sky22333","description":"轻量级 QQbot 通知机器人，支持API接口推送信息，支持SDK集成","archived":false,"fork":false,"pushed_at":"2026-03-17T16:16:40.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-18T01:41:57.945Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/sky22333.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-17T08:54:31.000Z","updated_at":"2026-03-17T16:21:20.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sky22333/qqbot","commit_stats":null,"previous_names":["sky22333/qqbot"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sky22333/qqbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sky22333%2Fqqbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sky22333%2Fqqbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sky22333%2Fqqbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sky22333%2Fqqbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sky22333","download_url":"https://codeload.github.com/sky22333/qqbot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sky22333%2Fqqbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31483383,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T17:22:55.647Z","status":"ssl_error","status_checked_at":"2026-04-06T17:22:54.741Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-04-06T18:02:47.192Z","updated_at":"2026-04-06T18:03:39.442Z","avatar_url":"https://github.com/sky22333.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qqbot\n\n轻量级 QQ 通知机器人，支持 HTTP 与 Go SDK 接入，提供同步发送、异步队列、状态查询与目标自动采集能力，内置失败重试，部署简单、使用方便。\n\n## 1. 快速开始\n\n- 已开通 QQ 机器人并拿到 `app_id`、`client_secret`\n- 开通地址：https://q.qq.com/qqbot/openclaw/login.html\n\n使用docker-compose部署：\n\n```yaml\nservices:\n  qqbot:\n    image: ghcr.io/sky22333/qqbot\n    container_name: qqbot\n    restart: always\n    ports:\n      - \"8080:8080\"\n    volumes:\n      - ./configs/config.toml:/root/config.toml\n      - ./data:/root/data\n```\n\n`config.toml`最小配置示例：\n```toml\n[qqbot]\napp_id = \"你的AppID\"\nclient_secret = \"你的ClientSecret\"\nmarkdown = false\n\n[server]\nlisten_addr = \":8080\"\napi_token = \"强密码token\"\n```\n\n启动服务后，需要用自己的 QQ 给机器人发一次消息，让系统自动采集目标ID后才能正常推送信息。\n\n## 2. 推送测试\n```\n# 异步推送\ncurl -X POST \"http://127.0.0.1:8080/api/v1/messages\" \\\n  -H \"Authorization: Bearer 接口鉴权token\" \\\n  -H \"Content-Type: application/json; charset=utf-8\" \\\n  -d '{\"content\":\"这是一条异步推送测试\"}'\n\n# 同步推送\ncurl -X POST \"http://127.0.0.1:8080/api/v1/messages/send\" \\\n  -H \"Authorization: Bearer 接口鉴权token\" \\\n  -H \"Content-Type: application/json; charset=utf-8\" \\\n  -d '{\"content\":\"这是一条同步推送测试\"}'\n```\n\n\n## 3. 常用命令\n\n```bash\n# 运行测试\ngo test ./...\n\n# 静态检查\ngo vet ./...\n\n# 直接运行\ngo run ./cmd/qqbotd -config configs/config.toml\n\n# 构建\ngo build ./cmd/qqbotd\n\n# 生产环境构建\ngo build -trimpath -ldflags \"-s -w -buildid=\" -o qqbotd ./cmd/qqbotd\n```\n\n## 4. HTTP 调用方式\n\n除健康检查外，业务接口都需要鉴权：\n\n```http\nAuthorization: Bearer 你的api_token\nContent-Type: application/json\n```\n\n#### 4.1 同步发送 `POST /api/v1/messages/send`\n\n```json\n{\n  \"target_type\": \"c2c\",\n  \"content\": \"这是一条通知\"\n}\n```\n\n`target_id` 可选；不传时自动使用最近采集目标。  \n`target_type` 也可选；不传时自动使用最近采集目标的类型与 ID。\n\n#### 4.2 异步入队 `POST /api/v1/messages`\n\n```json\n{\n  \"target_type\": \"group\",\n  \"content\": \"这是一条群通知\"\n}\n```\n\n`target_id` 可选；不传时自动使用最近采集目标。\n\n#### 4.3 查询状态 `GET /api/v1/messages/{request_id}`\n\n#### 4.4 查询目标 `GET /api/v1/targets`\n\n可选参数：`target_type=c2c|group|channel`\n\n#### 4.5 健康检查（无需鉴权）\n\n- `GET /healthz`\n- `GET /readyz`\n\n## 5. 目标采集\n\n启动服务后，用自己的 QQ 给机器人发消息，系统会自动采集目标并写入 `targets.file_path` 对应的文件（默认 `data/targets.json`）。  \n可通过 `GET /api/v1/targets` 查看。\n\n## 6. 时效与可达性说明\n\n- `target_id`（如 `user_openid`）作为发送目标标识可长期保存，不按 TTL 失效\n- 服务端调用凭证 `access_token` 会过期，项目已自动刷新\n- 当前项目仅发送文本或 markdown，不包含富媒体 `file_info` 链路\n- 是否可送达受平台规则影响：用户关闭主动消息、频控超限都会导致发送失败\n- 建议用异步接口发送，并通过 `GET /api/v1/messages/{request_id}` 跟踪状态\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsky22333%2Fqqbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsky22333%2Fqqbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsky22333%2Fqqbot/lists"}