8000 GitHub - zoudingyi/wechaty-robot: 基于 wechaty-puppet-padplus 的微信机器人助手
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

基于 wechaty-puppet-padplus 的微信机器人助手

Notifications You must be signed in to change notification settings

zoudingyi/wechaty-robot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wechaty-robot

基于 wechaty-puppet-padplus 协议的微信机器人助手,适用于微信好友管理及群管理,可以帮你省去一系列重复繁琐的操作。

wechaty-puppet-padplus协议于2020年已停用,更换协议为wechaty-puppet-padlocal

功能

  • 自动处理好友请求
  • 私聊关键字回复
  • 通过指令完成指定任务
  • 群管理(拉人进群、踢人出群、@群成员)
  • 收发文本
  • 收发个人名片
  • 收发图文链接
  • 接收、发送图片、文件(对内容有大小限制,25M以下)
  • 接收、发送视频
  • 发送小程序
  • 接收、发送动图
  • 接收、发送语音消息
  • 转发文本
  • 转发图片
  • 转发图文链接
  • 转发音频
  • 转发视频
  • 转发文件
  • 转发动图
  • 转发小程序

结构

|-- img                     # 储项目所使用到的图片与其他相应资源。
|-- src/
|---- listeners/
|------ on-scan.js          # 机器人需要扫描二维码时监听回调
|------ on-room.js          # 进入房间监听回调
|------ on-message.js       # 消息监听回调
|------ on-friend.js        # 好友添加监听回调
|---- config.js             # 配置文件
|---- index.js              # 入口文件
|-- package.json

依赖

wechaty:wechaty 核心库
wechaty-puppet-padplus:wechaty 的 ipad 协议实现

wechaty-puppet-padlocal:wechaty 的 ipad 协议实现

代码介绍

// init
const bot = new Wechaty({
  puppet: new PuppetPadplus({
    token: config.token
  }),
  name: config.name
})

bot.on('scan', onScan) // 机器人需要扫描二维码时监听
bot.on('login', (user) => log.info('StarterBot', '%s login', user))
bot.on('logout', (user) => log.info('StarterBot', '%s logout', user))
bot.on('message', onMessage(bot)) // 消息监听
bot.on('friendship', onFriendShip) // 添加好友监听
bot.on('room-join', onRoomJoin) // 加入房间监听

bot
  .start()
  .then(() => {
    log.info('StarterBot', 'Starter Bot Started.')
  })
  .catch((e) => log.error('StarterBot', e))

本地运行

  1. 克隆项目
git clone https://github.com/zoudingyi/wechaty-robot.git

cd wechaty-robot
  1. 安装依赖
npm install
  1. 启动项目
npm run serve

使用

  1. 打开src/config.js 文件
  2. 修改config配置
  3. 运行项目

效果图

img

About

基于 wechaty-puppet-padplus 的微信机器人助手

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0