wechaty-room-forward

0.0.3 • Public • Published

wechaty-room-forward

Wechaty Plugin Contrib Powered by Wechaty

Monitor message forwarding

监听群内提到自己的消息转发到主人

简介

监听机器人所在每一个群聊的消息,如果消息提到自己就会按一定格式转发到主人微信

安装

npm install wechaty-room-forward

使用

const wechatyRoomForward = require("wechaty-room-forward")

const options = {
    botName:'botName',
  	bossName: 'bossName'
}

bot.use(wechatyRoomForward(options))

如上所示

使用插件只要按需传入配置对象 options 即可

Options 参数属性 类型 简介
botName String 机器人微信昵称
bossName String 接收人微信昵称

示例

const { Wechaty } = require("wechaty");
const { PuppetPadlocal } = require("wechaty-puppet-padlocal");
const Qrterminal = require("qrcode-terminal")
// 插件 wechatyRoomForward
const wechatyRoomForward = require("wechaty-room-forward")

// 初始化 bot
const bot = new Wechaty({
  puppet: new PuppetPadlocal({
    // PUPPET_PADLOCAL_TOKEN TOKEN
    token: PUPPET_PADLOCAL_TOKEN,
  }),
})

// 插件参数配置
const options = {
  botName:"蔚蓝",
  bossName: ':)'
}


// 使用插件
bot.use(wechatyRoomForward(options));

bot
  .on("scan", (qrcode, status) => {
    Qrterminal.generate(qrcode, { small: true })
  })
  .start()

效果实现

https://z3.ax1x.com/2021/04/16/cWZHET.png

Package Sidebar

Install

npm i wechaty-room-forward

Weekly Downloads

1

Version

0.0.3

License

ISC

Unpacked Size

3.47 kB

Total Files

3

Last publish

Collaborators

  • brujie