[New Puppet] PuppetWechat4u - enable by `WECHATY_PUPPET=wechat4u`
Created by: huan
Today, wechaty has only one puppet support: PuppetWeb
, which is powered by Selenium WebDriver with Chrome Browser.
PuppetWeb
has the following pros and cons:
Advantages
- No need to deal with wechaty server API changes. Webdriver puppet never touches the HTTP protocol of wechaty web server API; It uses webdriver to hook angularjs in the browser. So it will never mind the server API change.
- Behavior not like a bot. It's very like a user use the browser.
Disadvantages
- Memory pig. The browser will eat about 100-500MB memory. After serval hours, the situation will be worse, might over 1GB with an active wechat account which has more contacts, more big rooms.
- Complicated configuration. If you had set a headless browser under a Linux server, you would understand what I mean. (It became a bit better after Dockerized: https://github.com/wechaty/wechaty/issues/66)
About Wechat4U
Wechat4U is an excellent wechat bot framework that supports both Node.js & Browser, with rich features and an active community of experienced contributors.
So I believe it's a bright decision to made a new Puppet like PuppetWechat4U
, to let wechaty users have the second way to use wechaty: not only by Browser Hook but also by Server API Call.
The Plan
This practice will be a good chance to check the wechaty abstract/base classes(the codes under /src
directory), to start decoupling with the WebDriver and become more robust, more reusable for the future possible PuppetAndroid
, PuppetAndroidPad
, PuppetIos
, PuppetIosPad
.
TBD