{"id":17967531,"url":"https://github.com/flaribbit/xkbot-QQbot","last_synced_at":"2025-03-25T08:31:21.267Z","repository":{"id":46612905,"uuid":"272372535","full_name":"flaribbit/xkbot-QQbot","owner":"flaribbit","description":"基于go-cqhttp的QQ机器人","archived":false,"fork":false,"pushed_at":"2023-11-12T02:02:23.000Z","size":363,"stargazers_count":17,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T12:02:14.994Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/flaribbit.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-15T07:37:22.000Z","updated_at":"2024-03-14T03:06:26.000Z","dependencies_parsed_at":"2024-10-29T14:29:17.307Z","dependency_job_id":null,"html_url":"https://github.com/flaribbit/xkbot-QQbot","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/flaribbit%2Fxkbot-QQbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaribbit%2Fxkbot-QQbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaribbit%2Fxkbot-QQbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaribbit%2Fxkbot-QQbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flaribbit","download_url":"https://codeload.github.com/flaribbit/xkbot-QQbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245426249,"owners_count":20613316,"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":[],"created_at":"2024-10-29T14:09:04.199Z","updated_at":"2025-03-25T08:31:20.896Z","avatar_url":"https://github.com/flaribbit.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# xkbot\n\n为了方便自己而编写的机器人，缓慢更新中\n\n## 使用说明\ngo-cqhttp 开启**反向ws，端口 5700**\n```yaml\n# ...\n  - ws-reverse:\n      disabled: false\n      universal: ws://127.0.0.1:5700\n# ...\n```\n\n在 `index.ts` 中导入要使用的插件，使用 `npm run start` 运行机器人。\n\n但默认所有插件都是关闭的，还需要机器人管理员或者群管理员手动开启。\n\n机器人管理命令和使用说明：\n- `.bot plugins 查看已安装插件`\n- `.bot status 查看插件状态`\n- `.bot on \u003c插件名称\u003e 开启插件`\n- `.bot off \u003c插件名称\u003e 关闭插件`\n- `.bot help \u003c插件名称\u003e 查看插件说明`\n\n## 插件说明\n### baike.ts\n萌娘百科查询\n- `萌娘百科搜\u003c搜索内容\u003e`\n\n### bililive.ts\n直播间监控，还没重构完成\n\n### bvinfo.ts\n当消息中包含BV号或者B站视频链接时，解析视频封面和基本信息\n- `BV1Tb4y1t7t4`\n- `https://www.bilibili.com/video/BV1Mr4y1679f`\n- `https://b23.tv/D3GD91g`\n\n### dice.ts\n简单的骰娘，还没重构完成（这就）\n- `.dice`\n\n### latex.ts\n当消息中包含latex公式时，渲染成图片\n- `$\\frac{\\pi}{2}$`\n\n### setu.ts\n随机色图，图库我自己建的\n- `@\u003c机器人\u003e 来张色图`\n\n### techmino.ts\n俄罗斯方块场地转换工具\n- `Techmino Field:eJwdy1EKAEEIAlCUghDB+9923O1DHmi7oK2Z24rVnQH8UpVEpGxMjoRadtOs+obvHjwlAYc=`\n\n### throwit.ts\n把群友的头像丢出去\n- `/丢 \u003c@xxx\u003e`\n- `/丢 \u003cQQ号\u003e`\n\n### translate.ts\n词典工具\n- `/en \u003cword\u003e` 英中\n- `/jp \u003cword\u003e` 日中\n\n## 如何编写自己的插件\n\n在 `plugins/myplugin.ts` 中编写\n\n```ts\n// plugins/myplugin.ts\nimport type { Handle } from \"../bot\"\nexport const name = \"插件名\"\nexport const handle: Handle = function (message, reply, info) {\n    reply(\"你好\")\n}\n```\n\n然后在 `index.ts` 中添加\n\n```ts\nbot.use(require(\"./plugins/myplugin\"))\n```\n\n无情的说“你好”机器就诞生啦！\n\n如果需要异步的函数，那就这样\n\n```ts\n// plugins/myplugin.ts\nimport type { Handle } from \"../bot\"\nexport const name = \"插件名\"\nexport const handle: Handle = function (message, reply, info) {\n    foo(message.message).then(reply).catch(e=\u003ereply(\"炸了\"))\n}\n\nasync function foo(msg: string): Promise\u003cstring\u003e {\n    // 可以在这里用 await 啦\n    return \"bar\"\n}\n```\n\n或者干脆把 `reply` 也传过去！就不用 `then` 啦！\n\n## 为什么命令前缀都不统一\n其实我是喜欢用 `.` 的，色图功能为了防止复读刷屏要求手动艾特，丢人功能抄隔壁机器人用 `/` 我也就跟着用了。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaribbit%2Fxkbot-QQbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflaribbit%2Fxkbot-QQbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaribbit%2Fxkbot-QQbot/lists"}