{"id":19046370,"url":"https://github.com/wwkk-y/dhm-bot","last_synced_at":"2025-09-07T04:31:17.397Z","repository":{"id":242475843,"uuid":"809636317","full_name":"wwkk-y/dhm-bot","owner":"wwkk-y","description":"基于LLOneBot的QQ机器人","archived":false,"fork":false,"pushed_at":"2024-06-08T05:45:46.000Z","size":55,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-08T22:54:26.554Z","etag":null,"topics":["js","llonebot","qqbot"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wwkk-y.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}},"created_at":"2024-06-03T06:50:18.000Z","updated_at":"2024-06-17T05:15:20.000Z","dependencies_parsed_at":"2024-06-10T22:18:49.583Z","dependency_job_id":null,"html_url":"https://github.com/wwkk-y/dhm-bot","commit_stats":null,"previous_names":["wwkk-y/dhm-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwkk-y%2Fdhm-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwkk-y%2Fdhm-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwkk-y%2Fdhm-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wwkk-y%2Fdhm-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wwkk-y","download_url":"https://codeload.github.com/wwkk-y/dhm-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232174876,"owners_count":18483497,"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":["js","llonebot","qqbot"],"created_at":"2024-11-08T22:54:32.486Z","updated_at":"2025-01-02T08:44:28.639Z","avatar_url":"https://github.com/wwkk-y.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"本项目是一个基于LLOneBot的QQ机器人\n\n* node版本: 22.2.0\n\n* [LLOneBot](https://github.com/LLOneBot/LLOneBot) 版本: 3.26.4 \n\n使用pnpm进行管理, 安装方法\n\n```bash\nnpm i -g pnpm\npnpm i\n```\n\n在 /config/LLOneBotConfig.js 里面修改配置\n\n```js\nexport default {\n    mode: \"http\", // 模式 http(http发送请求 + 事件上报), 未来支持WebSocket\n    httpServer: {\n        url: \"http://127.0.0.1\", // Http服务地址\n        port: 3110 // 端口\n    },\n    httpSubmit: { // http上报端口\n        port: 31111, // 请求端口\n        urlPath: \"/bot/submit\" // 请求路径\n    },\n    webSocket: {\n        \n    }\n}\n```\n\n文件命名规范\n\n- 多个单词大驼峰\n- 单个单词小写(除非专用词)\n\n编码规划\n\n- 函数里不应该修改对象参数, 如果需要, 拷贝一份对象再使用\n\n## http 模式流程\n\n服务器 -\u003e 收到信息 -\u003e 分析信息 -\u003e 发布信息到对应分类\n\n处理器 -\u003e 订阅信息 -\u003e 处理\n\n订阅内容: \n\n* [上报消息](https://docs.go-cqhttp.org/event/#%E6%89%80%E6%9C%89%E4%B8%8A%E6%8A%A5)\n* [消息类型](https://docs.go-cqhttp.org/cqcode/#%E8%BD%AC%E4%B9%89)\n\n```js\n{\n    ...msg, // msg详见上报消息\n    content: \"内容\", // 检测 文本消息内容 (指令)\n    atMe: true, // 是否 at 自己\n}\n```\n\n### 编写 plugin 步骤\n\n* 在 src/plugins/ 里建立一个新的 plugin 包, 写一个主程序js文件\n* 修改 src/plugins/config.js, 在 plugins 里添加 主程序 js 文件\n\n```js\n// test-plugin/app.js\nimport MsgSubUtil from '../../util/MsgSubUtil.js'\n\nMsgSubUtil.subPrefixR(\"#\", (msg) =\u003e {\n    return \"收到指令: \" + msg.content;\n})\n```\n\n```js\nexport default {\n    plugins: [\"./test-plugin/app.js\"]\n}\n```\n\n## TODO\n\n* 参数校验\n* 订阅超时检验","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwwkk-y%2Fdhm-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwwkk-y%2Fdhm-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwwkk-y%2Fdhm-bot/lists"}