wechaty-room-forward
v0.0.3
Published
Monitor message forwarding
Downloads
4
Maintainers
Readme
wechaty-room-forward
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()