npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wechaty-puppet-bridge

v0.10.4

Published

Puppet Bridge for Wechaty

Downloads

1,934

Readme

Wechaty Puppet Bridge

NPM NPM Version npm (tag) npm downloads

简介

wechaty-puppet-bridge 是一个虚拟的Wechaty Puppet,实际上它只是一个桥接服务,它将GitHub中开源的机器人桥接到Wechaty,是开源IM bot搬运工

如果你想方便且高效的使用免费的机器人,那么它是一个很好的选择,它不需要token同时又能使用Wechaty进行聊天机器人开发

与wechaty-puppet-xp比较:

| 项目 | puppet-xp | puppet-bridge | | :------------- |:-------------| :-----| | 手动注入 | ⭐⭐⭐不需要 | ⭐⭐⭐不需要 | | 功能| ⭐⭐⭐基于cixingguangming55555/wechat-bot项目 | ⭐⭐⭐基于cixingguangming55555/wechat-botjwping/wxbotttttupup/wxhelper等开源项目 | | 梯子 | ⭐依赖frida,国内网络无法安装,需使用梯子 | ⭐⭐⭐不需要,直接运行程序即可 | | 启动| ⭐⭐⭐直接运行nodejs程序 | ⭐⭐需先手动启动确认启动,但很简单| | 环境| ⭐⭐⭐nodejs | ⭐⭐nodejs|

获取更多信息访问项目语雀文档

功能清单

wechaty-puppet-bridge 是一个全新的wechaty-puppet,它可以连接所有的通过ws、http、mqtt开放IM访问的聊天机器人.

最新功能清单查看功能清单

功能清单

机器人支持

  1. Wechat-bot 馈人玫瑰之手,历久犹有余香 cixingguangming55555/wechat-bot

  2. wxbot - 聊天机器人 jwping/wxbot

  3. wxhelper - PC端微信逆向学习 ttttupup/wxhelper

快速开始

使用cixingguangming55555/wechat-bot

  1. 在您的Windows电脑上安装客户端(需要版本v3.9.2.23,下载v3.9.2.23

  2. 在电脑上登录客户端

  3. 运行以下指令启动程序,程序启动时会自动打开注入程序,运行程序并点击【Start】开启功能。

git clone https://github.com/atorber/puppet-bridg
cd puppet-bridge

# 安装依赖
npm install

# 启动程序
npm start
#
# Do not forget to install WeChat with requried version and login.
#

image

使用jwping/wxbot

  1. 在您的Windows电脑上安装客户端(需要版本v3.9.8.25,下载v3.9.8.25

  2. 在电脑上登录客户端

  3. 运行以下指令启动程序

git clone https://github.com/atorber/puppet-bridg
cd puppet-bridge

# 安装依赖
npm install

# 启动程序
npm run start:ripe-bridge-jwping-wxbot:info
#
# Do not forget to install WeChat with requried version and login.
#

使用NPM包

puppet-bridge 已经在NPM上发布了安装包,Wechaty用户可以直接安装使用

npm i wechaty-puppet-bridge

示例代码:

import {
    WechatyBuilder,
    log,
  } from 'wechaty'
  import { FileBox } from 'file-box'
  import {PuppetBridgeCixingguangming55555WechatBotV3090223 as PuppetBridge } from 'wechaty-puppet-bridge'
  
  async function onLogin (user) {
    log.info('onLogin', '%s login', user)
    const roomList = await bot.Room.findAll()
    console.info('room count:', roomList.length)
    const contactList = await bot.Contact.findAll()
    console.info('contact count:', contactList.length)
  }
  
  async function onMessage (message) {
    log.info('onMessage', JSON.stringify(message))
  
    // 1. send Image
    if (/^ding$/i.test(message.text())) {
      const fileBox = FileBox.fromUrl('https://wechaty.github.io/wechaty/images/bot-qr-code.png')
      await message.say(fileBox)
    }
  
    // 2. send Text
  
    if (/^dong$/i.test(message.text())) {
      await message.say('dingdingding')
    }
  
  }
  
  const puppet = new PuppetBridge({
   token: '大师'  // 当前登录账号的昵称作为token
   })

  const bot = WechatyBuilder.build({
    name: 'ding-dong-bot',
    puppet,
  })
  
  bot.on('login', onLogin)
  bot.on('message', onMessage)
  
  bot.start()
    .then(() => {
      return log.info('StarterBot', 'Starter Bot Started.')
    })
    .catch(console.error)
import {
    WechatyBuilder,
    log,
  } from 'wechaty'
  import { FileBox } from 'file-box'
  import { PuppetBridgeJwpingWxbotV3090825 as PuppetBridge } from 'wechaty-puppet-bridge'

  async function onLogin (user) {
    log.info('onLogin', '%s login', user)
    const roomList = await bot.Room.findAll()
    console.info('room count:', roomList.length)
    const contactList = await bot.Contact.findAll()
    console.info('contact count:', contactList.length)
  }
  
  async function onMessage (message) {
    log.info('onMessage', JSON.stringify(message))
  
    // 1. send Image
    if (/^ding$/i.test(message.text())) {
      const fileBox = FileBox.fromUrl('https://wechaty.github.io/wechaty/images/bot-qr-code.png')
      await message.say(fileBox)
    }
  
    // 2. send Text
  
    if (/^dong$/i.test(message.text())) {
      await message.say('dingdingding')
    }
  
  }
  
  const puppet = new PuppetBridge()

  const bot = WechatyBuilder.build({
    name: 'ding-dong-bot',
    puppet,
  })
  
  bot.on('login', onLogin)
  bot.on('message', onMessage)
  
  bot.start()
    .then(() => {
      return log.info('StarterBot', 'Starter Bot Started.')
    })
    .catch(console.error)

需要【以管理员身份运行】WeChat客户端

import {
    WechatyBuilder,
    log,
  } from 'wechaty'
  import { FileBox } from 'file-box'
  import { PuppetBridgeAtorberFusedV3090825 as PuppetBridge } from 'wechaty-puppet-bridge'

  async function onLogin (user) {
    log.info('onLogin', '%s login', user)
    const roomList = await bot.Room.findAll()
    console.info('room count:', roomList.length)
    const contactList = await bot.Contact.findAll()
    console.info('contact count:', contactList.length)
  }
  
  async function onMessage (message) {
    log.info('onMessage', JSON.stringify(message))
  
    // 1. send Image
    if (/^ding$/i.test(message.text())) {
      const fileBox = FileBox.fromUrl('https://wechaty.github.io/wechaty/images/bot-qr-code.png')
      await message.say(fileBox)
    }
  
    // 2. send Text
  
    if (/^dong$/i.test(message.text())) {
      await message.say('dingdingding')
    }
  
  }
  
  const puppet = new PuppetBridge()

  const bot = WechatyBuilder.build({
    name: 'ding-dong-bot',
    puppet,
  })
  
  bot.on('login', onLogin)
  bot.on('message', onMessage)
  
  bot.start()
    .then(() => {
      return log.info('StarterBot', 'Starter Bot Started.')
    })
    .catch(console.error)

需要【以管理员身份运行】WeChat客户端

import {
    WechatyBuilder,
    log,
  } from 'wechaty'
  import { FileBox } from 'file-box'
  import { PuppetBridgeTtttupupWxhelperV3090581 as PuppetBridge } from 'wechaty-puppet-bridge'

  async function onLogin (user) {
    log.info('onLogin', '%s login', user)
    const roomList = await bot.Room.findAll()
    console.info('room count:', roomList.length)
    const contactList = await bot.Contact.findAll()
    console.info('contact count:', contactList.length)
  }
  
  async function onMessage (message) {
    log.info('onMessage', JSON.stringify(message))
  
    // 1. send Image
    if (/^ding$/i.test(message.text())) {
      const fileBox = FileBox.fromUrl('https://wechaty.github.io/wechaty/images/bot-qr-code.png')
      await message.say(fileBox)
    }
  
    // 2. send Text
  
    if (/^dong$/i.test(message.text())) {
      await message.say('dingdingding')
    }
  
  }
  
  const puppet = new PuppetBridge()

  const bot = WechatyBuilder.build({
    name: 'ding-dong-bot',
    puppet,
  })
  
  bot.on('login', onLogin)
  bot.on('message', onMessage)
  
  bot.start()
    .then(() => {
      return log.info('StarterBot', 'Starter Bot Started.')
    })
    .catch(console.error)

更新日志

v0.10.4

  • 修复wxbot无法发送图片bug

v0.10.3

  • 修复注入文件路径错误问题

v0.10.1

  • 支持接收图片(注意当前的实现方式可能存在并发接收图片消息时接收不到或图片与消息不匹配的情况)

v0.10.0

  • PuppetBridgeAtorberFusedV3090825支持@all,使用方法room.say('Hi~', ...[SelfContact])
  • PuppetBridgeAtorberFusedV3090825支持发送多个不同的@消息,使用方法room.say('{"chatRoomId":"xxxx","at":[{"wxid":"wxid_xxx","msg":"@xxx"}]}')

v0.9.0

  • 修复npm包无法找到注入工具的问题

v0.8.10

  • 增加contactPayloadDirty更新联系人缓存

v0.8.9

  • 修复部分群成员查询失败导致无法出发登录事件的问题

v0.8.8

  • 修复__dirname重复定义的问题

v0.8.7

  • wxhelper类抽离,支持指定httpUrl
  • fused类抽离,支持指定httpUrl

v0.8.2

  • 优化注入逻辑,当设置了httpUrl时,不自动注入,默认为已完成手动注入
  • 当http服务已存在时不重复注入

v0.7.0

  • 升级atorber-fused仅需要ttttupup/wxhelper启动
  • 拓展ttttupup/wxhelper使用32.获取数据库句柄拓展支持:
    • 47.获取群详情
    • 25.获取群成员
    • 60.获取群/群成员详情
  • 支持自动注入及自动登录

v0.6.1

  • 新增atorber-fused融合brisge,集合jwping/wxbotttttupup/wxhelper两个项目的3.9.8.25版本的功能合集
  • 支持自动注入及自动登录

v0.6.0

  • 适配 ttttupup/wxhelper,支持v3.9.5.81版本,功能最全的免费机器人
  • 自动注入

v0.4.0 (2023-2-1)

适配 jwping/wxbot 项目,支持v3.9.8.25版本

v0.1.0 (2023-1-21)

初始化版本,适配 cixingguangming55555/wechat-bot 项目,支持v3.9.2.23版本