{"id":16880754,"url":"https://github.com/wtdcode/coolqjavabot","last_synced_at":"2026-05-20T10:43:55.122Z","repository":{"id":110681045,"uuid":"109564494","full_name":"wtdcode/CoolqJavaBot","owner":"wtdcode","description":"一个基于CoolqSocketAPI二次开发的CoolqJavaBot","archived":false,"fork":false,"pushed_at":"2018-01-01T11:53:44.000Z","size":209,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-20T03:39:23.547Z","etag":null,"topics":["coolq","java"],"latest_commit_sha":null,"homepage":"","language":"Java","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/wtdcode.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":"2017-11-05T09:54:20.000Z","updated_at":"2017-11-30T10:28:02.000Z","dependencies_parsed_at":"2023-04-10T21:31:10.992Z","dependency_job_id":null,"html_url":"https://github.com/wtdcode/CoolqJavaBot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wtdcode/CoolqJavaBot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtdcode%2FCoolqJavaBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtdcode%2FCoolqJavaBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtdcode%2FCoolqJavaBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtdcode%2FCoolqJavaBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wtdcode","download_url":"https://codeload.github.com/wtdcode/CoolqJavaBot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtdcode%2FCoolqJavaBot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33255859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-20T04:48:54.280Z","status":"ssl_error","status_checked_at":"2026-05-20T04:48:10.851Z","response_time":356,"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":["coolq","java"],"created_at":"2024-10-13T15:59:58.950Z","updated_at":"2026-05-20T10:43:55.095Z","avatar_url":"https://github.com/wtdcode.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CoolqJavaBot\n\n## 简介\n\n一个基于[CoolqSocketAPI](https://github.com/yukixz/cqsocketapi)二次开发的CoolqJavaBot。\n\n感谢@[jqqqqqqqqqq](https://github.com/jqqqqqqqqqq)给与了非常多的关键性指导（以及他的[repo](https://github.com/jqqqqqqqqqq/coolq-telegram-bot)）。\n\n因为Coolq没有现成的Java轮子，只能自己造了。\n\n## 最近\n\n- 把Sender和Dispatcher全部放入Server，预计以后结构不会有太大变化了。\n- 过滤图片、表情、at信息完成。\n- repo改名，跟sdk还差得远呢（。\n\n## TODO\n\n- **为所有的`ex.printStackTrace()`加上应有的异常处理。**\n- 把协议中剩余的Msg全部实现，并添加相应的deal接口。\n- 测试框架的稳定性。\n- 按照群组分发信息，构造一个GroupManager?\n\n\n## 配置环境\n\n其实Coolq部分主要是用CoolqSocketAPI转发消息，所以直接去找别人编译好的就好了（逃\n\n[在这里](https://github.com/jqqqqqqqqqq/coolq-telegram-bot/releases)下载最新的CoolqSocketAPI后放到Coolq的插件目录，在Coolq插件里启动即可。\n\n然后请在根目录下放置一个config.json文件用于环境配置，我已经提供了一个example供参考\n\n```json\n{\n    \"database\": { \n        \"driver\": \"com.mysql.jdbc.Driver\", \n        \"url\": \"jdbc:mysql://127.0.0.1:3306/someSchema\", \n        \"username\": \"usr\", \n        \"password\": \"pwd\" \n    },\n    \"target_port\": 11235, \n    \"server_port\": 23333, \n    \"admin\": \"12450\" \n}\n```\n\n其中target_port是cqsocketapi监听端口，一般是11235，而server_port就是bot的端口，只要不冲突可以随意设置，admin是Bot管理的QQ号（未实现功能）。\n\n## 一个简单的复读机\n\n```java\nimport cqjsdk.msg.*;\nimport cqjsdk.server.*;\n\npublic class Main {\n    class FuDuJi extends CQJModule {\n        public FuDuJi(){\n            String[] strings ={\"GroupMessage\"};\n            register(strings); // 这里注册监听的信息种类\n        }\n        protected Msg dealGroupMsg(RecvGroupMsg msg){\n            String text = msg.getText();\n            text = \"（\".concat(text).concat(\"）\"); // 构造付读字符串\n            SendGroupMsg smsg = new SendGroupMsg(msg.getGroup(), text);\n            return Msg.SendandNext(smsg); // 表示发送并且不截断\n        }\n    }\n    public void go(){\n        FuDuJi f = new FuDuJi(); // 实例化Module\n        Server c = Server.getServer(11235,23333); // 创建服务端\n        c.start();\n    }\n    public static void main(String[] args){\n        Main fdj = new Main();\n        fdj.go();\n    }\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtdcode%2Fcoolqjavabot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwtdcode%2Fcoolqjavabot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtdcode%2Fcoolqjavabot/lists"}