Giter VIP home page Giter VIP logo

node's Introduction

go-cqhttp/node

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

启动

插件

配置插件

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

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

内置插件

插件 说明
almanac 黄历插件
blank 空白插件
chives 韭菜插件
dapan 大盘插件
dog 舔狗日记
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, 你也可以用其它方法后台运行

其它

node's People

Contributors

zhuweiyou avatar

Watchers

James Cloos avatar

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.