Skip to content

Nodejs 封装网页版微信的接口,可编程控制微信消息

Notifications You must be signed in to change notification settings

yq5858588/WeixinBot

 
 

Repository files navigation

__    __       _        _           ___         _
/ / /\ \ \ ___ (_)__  __(_) _ __    / __\  ___  | |_
\ \/  \/ // _ \| |\ \/ /| || '_ \  /__\// / _ \ | __|
 \  /\  /|  __/| | >  < | || | | |/ \/  \| (_) || |_
  \/  \/  \___||_|/_/\_\|_||_| |_|\_____/ \___/  \__|
                                 微信Nodejs版 by feit

Nodejs 封装网页版微信的接口,可编程控制微信消息

NPM version Dependencies Status

Install

npm install weixinbot --save

Usage

// Require Nodejs v8+

// index.js
const Weixinbot = require('weixinbot')

// will send qrcode to your email address
const bot = new Weixinbot({ receiver: 'your@email.com' })

// will emit when bot fetch a new qrcodeUrl
bot.on('qrcode', (qrcodeUrl) => {
  console.log(qrcodeUrl)
})

bot.on('friend', (msg) => {
  console.log(msg.Member.NickName + ': ' + msg.Content)
  bot.sendText(msg.FromUserName, 'Got it')
})

bot.run()

Run

# We recommend show debug message under development
DEBUG=weixinbot node index.js

Feature

Remember previous login secret, when secret is valid, we can direct login without scan qrcode

License

The MIT license.

About

Nodejs 封装网页版微信的接口,可编程控制微信消息

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%