Giter Club home page Giter Club logo

for-node's Introduction

go-cqhttp/for-node

基于 go-cqhttp 和 nodejs 的 qq 机器人

启动

插件

配置插件

config.js 中配置的插件才会被加载, 并且需要在插件目录运行 npm install 安装依赖

// config.js
module.exports = {
  plugin: {
    // key: 可以是 npm 包名, 也可以是相对路径
    // value: 传给插件的配置对象 {}
    'path-to-plugin': {},
  },
}

内置插件

插件 说明
almanac 黄历插件
blank 空白插件
chives 韭菜插件
dapan 大盘插件
fund 基金查询
hot 热门词汇
mm 美女图片
qrcode 二维码
recall 消息防撤回
run-js 运行 JS
stock 股票查询
weibo 微博插件

开发插件

复制 plugin/blank, 参考其它插件和 https://docs.go-cqhttp.org 进行开发

/**
 * @param options 传给插件的配置
 */
module.exports = options => {
  /**
   * @param data 收到的消息
   * @param ws 机器人 WebSocket 实例
   * @param http 机器人 HTTP 实例
   */
  return async ({ data, ws, http }) => {
    // TODO:
  }
}

部署 (Linux)

  • 安装 screen 工具后: 后台运行 go-cqhttp/下载的文件 (screen 命令用法自行搜索)

  • 安装 pm2 工具后: 在根目录运行 npm start

  • 代码更新: 在根目录运行 npm run reload

因为 go-cqhttp 登录需要交互操作, 而 pm2 不支持, 所以这里用 screen 运行 go-cqhttp, 你也可以用其它方法后台运行

for-node's People

Contributors

zhuweiyou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

for-node's Issues

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.

更换图片接口后,发送图片速度慢

您好,可以向您请教一个问题吗?

由于觉得您的mm插件中图片比较暴露,我更换了图片接口,但是现在遇到了以下的问题:

通过返回的json中imgurl获取图片的地址,机器人在发送图片时的速度比较慢,有明显的间隔

图片的大小<1M(大概几百kb)

以下是源代码,在您mm插件基础上修改的

   let { data }= await axios("https://www.dmoe.cc/random.php?return=json")  
   const file = data.imgurl
   return [
         {
              type: 'image',
              data:
                    {
		       file	
                    }
         }
   ]

npm run dev时出错

image

Error: connect ECONNREFUSED 0.0.0.0:6700
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
Emitted 'error' event on WebSocket instance at:
at ClientRequest. (C:\Users\Administrator\Desktop\nodebot\node_modules\ws\lib\websocket.js:579:15)
at ClientRequest.emit (events.js:315:20)
at Socket.socketErrorListener (_http_client.js:469:9)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -4078,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '0.0.0.0',
port: 6700
}
[nodemon] app crashed - waiting for file changes before starting...

运行 npm run dev时报错

报错如下:


> dev
> cross-env NODE_ENV=development nodemon index.js

[nodemon] 2.0.16
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node index.js`
/root/node/node_modules/@pipcook/boa/lib/index.js:83
    const pyo = wrap(pyInst.import(name));
                                  ^

TypeError: ModuleNotFoundError: No module named 'wordcloud'
    at Object.import (/root/node/node_modules/@pipcook/boa/lib/index.js:83:35)
    at Object.<anonymous> (/root/node/plugin/hot/word-cloud.js:6:33)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/root/node/plugin/hot/service.js:3:19)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
[nodemon] app crashed - waiting for file changes before starting...

是否有群聊?

请问一下,这个项目有群吗?有一些疑惑和问题,想找人解答

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.