Puppet

Last updated 3 months ago

1. Intro

The term Puppet in Wechaty is an Abstract Class for implementing protocol plugins. The plugins are the component that helps Wechaty to control the Wechat(that's the reason we call it puppet).

The plugins are named PuppetXXX, like PuppetPuppeteer is using the google puppeteer to control the WeChat Web API via a chrome browser, PuppetPadchat is using the WebSocket protocol to connect with a Protocol Server for controlling the iPad Wechat program. More detail you could go Puppet in wiki.

For a deeper understanding of the Puppet in Wechaty, you can read its source code if you like at https://github.com/Chatie/wechaty-puppet/blob/master/src/puppet.ts

2. Wechaty Puppet List

2.1. For Puppet User

Wechaty Puppet

Backend Protocol

Npm Name

Npm Version

Stage

PuppetPuppeteer

Web API via Browser Hooking

wechaty-puppet-puppeteer

PuppetPuppeteer npm (tag)

Stage:Release

PuppetPadchat

iPad Protocol

wechaty-puppet-padchat

PuppetPadchat npm (tag)

Stage:Release

PuppetWechat4u

Web API via HTTP

wechaty-puppet-wechat4u

PuppetWechat4u npm (tag)

Stage:Release

PuppetIoscat

iPhone App Hooking

wechaty-puppet-ioscat

PuppetIoscat npm (tag)

Stage:Release

TBW

Android Hook

Android

0.0.0

Stage:Release

TBW

Win32 Hook

Win32

0.0.0

Stage:Release

2.2. For Puppet Builder

Wechaty Puppet

Backend Protocol

Npm Name

Npm Version

Stage

Puppet

Abstract Base Class

wechaty-puppet

Puppet npm (tag)

Stage:Release

PuppetMock

Mocking

wechaty-puppet-mock

PuppetMock npm (tag)

Stage:Release

3. Wechaty Puppet Compatibility

3.1 Puppet Contact API

Contact API

wechat4u & puppeteer

padchat

Ioscat

Permanent ContactPayload.id

No

Yes

No

ContactPayload.friend

No

Yes

Yes

3.2 Puppet Message API

Message API

wechat4u & puppeteer

padchat

Ioscat

messageSendContact()

No

Yes

No

messageFile()

Yes

Yes for Image/Audio/Video No for other Attachments

No

messageSendFile()

Yes

Yes for Image/Audio/Video No for other Attachments

No

messageSendUrl()

No

Yes

No

3.3 Puppet Room API

Room API

wechat4u & puppeteer

padchat

Ioscat

Permanent RoomPayload.id

No

Yes

No

roomQrcode()

No

Yes

Yes

roomCreate()

No

Yes

Yes

roomAdd()

No

Yes

Yes

roomDel()

No

Yes

Yes

roomQuit()

No

Yes

Yes

roomAnnounce()

No

Yes

Yes

roomPayload.owner

No

Yes

No

4. Learn More

Learn more about Wechaty Puppet at https://github.com/Chatie/wechaty-puppet/wiki