0.1.10 • Published 5 years ago

unique-wechaty-puppet-macpro v0.1.10

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
5 years ago

WECHATY-PUPPET-MACPRO

Install

  1. Init

    mkdir testPuppetMacpro
    
    npm init
  2. Install the latest wechaty

    npm install wechaty@next
  3. Install wechaty-puppet-macpro

    npm install wechaty-puppet-macpro
  4. Install other dependency

    npm install qrcode-terminal

Example

import {
  Wechaty,
} from 'wechaty';
import {
  PuppetMacpro
} from 'wechaty-puppet-macpro';
import QrcodeTerminal from 'qrcode-terminal';

const token = 'your token';

const puppet = new PuppetMacpro({
  token,
})

const bot = new Wechaty({
  puppet,
});

bot
  .on('scan', (qrcode) => {
    QrcodeTerminal.generate(qrcode, {
      small: true
    });
  })
  .on('message', async msg => {
    console.log(`msg : ${msg}`)
  })
  .start()