A Node SDK for developing QQ chatbots based on WebSocket, which is depending on CoolQ and CQHTTP API plugin.
本項目即日起停止維護,隨著酷Q、CQHTTP一同走入歷史,畫下完美句點。感謝各方好友的支持與參與。
依賴 CQHTTP API 插件的 websocket 接口, 為 NodeJs 開發者提供一個搭建 QQ 聊天機器人的 SDK。
關於 CQHTTP API 插件,見 richardchien/coolq-http-api
本 SDK 尚處於測試階段,使用上仍有機會碰到Bug,歡迎提交PR或issue回報。
由於付費問題,本 SDK 目前僅針對酷Q Air做測試。
本 SDK 採用 ava 框架執行測試。
npm run build
使用 webpack 將 SDK 及所有依賴打包, 並在 /dist
目錄下產生一個 cq-websocket.min.js
。
npm run build-demo
打包 /demo/webpack/app.js
內容, 在 /demo/webpack/www
目錄下產生一個 bundle.js
。
這是 Node 的問題, 暫時使用 Node 8.x 以下就沒問題。
RangeError [ERR_OUT_OF_RANGE]: The value of "value" is out of range. It must be >= 0 and <= 4294967295. Received -805456141
at checkInt (internal/buffer.js
11)
at writeU_Int32BE (internal/buffer.js
3)
at Buffer.writeUInt32BE (internal/buffer.js
10)
at WebSocketFrame.toBuffer (/***/node-cq-websocket/node_modules/websocket/lib/WebSocketFrame.js
24)
at WebSocketConnection.sendFrame (/***/node-cq-websocket/node_modules/websocket/lib/WebSocketConnection.js
43)
at WebSocketConnection.fragmentAndSend (/***/node-cq-websocket/node_modules/websocket/lib/WebSocketConnection.js
14)
at WebSocketConnection.sendUTF (/***/node-cq-websocket/node_modules/websocket/lib/WebSocketConnection.js
10)
at W3CWebSocket.send (/***/node-cq-websocket/node_modules/websocket/lib/W3CWebSocket.js
26)
請勿拍打 🤜 無限期掙飯中 ☕