-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to tell which puppet is being used #89
Comments
Thanks for asking this good question! First, I agree with you that we need a way to get to know which puppet we are currently using with Wechaty. This could be implemented by adding a new method to the puppet, let's say, named const name = wechaty.puppet.name()
console.info(name)
// Output: wechaty-puppet-padplus And when we are using the Please feel free to let me know what you think about this design. Secondly, I think all the puppet dependent API should not exist in Wechaty, which means the Wechaty should never care about what puppet it is using. Can we get a way to remove all those |
yeah, sure. good idea. One little add-on/clarification, when remove all those emoji related methods from Wechaty to the individual puppets, please keep the abstract function at puppets level, so they will be behaving the same when puppet is switched. |
Should be available after wechaty-puppet@0.23.4:
|
Thanks a lot! |
You are welcome! Todo: add an unit testing. |
Unit Testing added. |
* rename event `watchdog` to `heartbeat` (wechaty#88) * 0.23.1 * clear log message * 0.23.2 * reset for start * 0.23.3 * add name() method for getting the provider npm name (wechaty#89) * 0.23.4 * refactor PuppetTest to seprate module directory (wechaty#89) * 0.23.5 * Upgrade state-switch to support Observable * 0.23.6 * Upgrade StateSwitch to support RxJS fromEvent * fix options * 0.23.7 * --skipLibCheck * 0.23.8 * public state for rxjs helper function visit * 0.23.9 * 0.24.0 (wechaty#92) * increase the cache size for RoomMemberPayload from 10K to 30K * 0.23.10 * 0.25.1 Co-authored-by: Huan LI <zixia@zixia.net>
* Merge master (#18) * modify: create new latest version (#78) * clean file-box * 0.19.18 * 0.20.1 Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * Add receiverId to RoomInvitationPayload (#19) * modify: create new latest version (#78) * clean file-box * 0.19.18 * 0.20.1 * Add receiver to Room Invitation Payload. (#79) * Merge master (#18) * modify: create new latest version (#78) * clean file-box * 0.19.18 * 0.20.1 Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * fix: add receiver to room-invitation payload. * Update room-invitation.ts Co-authored-by: Huan (李卓桓) <zixia@zixia.net> Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * 0.21.11 * Merge master (#21) * modify: create new latest version (#78) * clean file-box * 0.19.18 * 0.20.1 * Add receiver to Room Invitation Payload. (#79) * Merge master (#18) * modify: create new latest version (#78) * clean file-box * 0.19.18 * 0.20.1 Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * fix: add receiver to room-invitation payload. * Update room-invitation.ts Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * Bump wechaty-puppet version (#80) * Merge master (#18) * modify: create new latest version (#78) * clean file-box * 0.19.18 * 0.20.1 Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * Add receiverId to RoomInvitationPayload (#19) * modify: create new latest version (#78) * clean file-box * 0.19.18 * 0.20.1 * Add receiver to Room Invitation Payload. (#79) * Merge master (#18) * modify: create new latest version (#78) * clean file-box * 0.19.18 * 0.20.1 Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * fix: add receiver to room-invitation payload. * Update room-invitation.ts Co-authored-by: Huan (李卓桓) <zixia@zixia.net> Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * 0.20.2 Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * 0.21.0 * BREAKING CHANGE: selfId() might return `undefined` now * 0.21.1 * 0.21.2 * add unknown to scene * 0.21.3 * fix link * rename chatie -> wechaty * 0.21.4 * 0.21.5 * clean enum numbers * `YOU` should only be used inside Puppet system, should not be passed to Wechaty * code clean * restore * 0.21.6 * Event payload abstract (#86) * Remove unused types in the abstract (#85) * Use object for all events (on/listen) for better encapsulate (#81) * use string for internal usage * 0.21.7 * restore XXX_EVENT_DICT * 0.21.8 * add payload for ready event * 0.21.9 * Enable GitHub Actions * 0.21.10 * code clean * 0.21.11 * doc Co-authored-by: Huan LI <zixia@zixia.net> * 0.25.1 * rename event `watchdog` to `heartbeat` (#88) * 0.23.1 * clear log message * 0.23.2 * reset for start * 0.23.3 * add name() method for getting the provider npm name (#89) * 0.23.4 * refactor PuppetTest to seprate module directory (#89) * 0.23.5 * Upgrade state-switch to support Observable * 0.23.6 * Upgrade StateSwitch to support RxJS fromEvent * fix options * 0.23.7 * --skipLibCheck * 0.23.8 * public state for rxjs helper function visit * 0.23.9 * 0.24.0 (#92) * increase the cache size for RoomMemberPayload from 10K to 30K * 0.23.10 * 0.25.1 Co-authored-by: Huan LI <zixia@zixia.net> * feat: modify friendshipAdd for support add room member be friends * 0.34.2 * fix: conflict bug Co-authored-by: Huan (李卓桓) <zixia@zixia.net>
* Add room member (wechaty#129) * Merge master (#18) * modify: create new latest version (wechaty#78) * clean file-box * 0.19.18 * 0.20.1 Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * Add receiverId to RoomInvitationPayload (#19) * modify: create new latest version (wechaty#78) * clean file-box * 0.19.18 * 0.20.1 * Add receiver to Room Invitation Payload. (wechaty#79) * Merge master (#18) * modify: create new latest version (wechaty#78) * clean file-box * 0.19.18 * 0.20.1 Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * fix: add receiver to room-invitation payload. * Update room-invitation.ts Co-authored-by: Huan (李卓桓) <zixia@zixia.net> Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * 0.21.11 * Merge master (#21) * modify: create new latest version (wechaty#78) * clean file-box * 0.19.18 * 0.20.1 * Add receiver to Room Invitation Payload. (wechaty#79) * Merge master (#18) * modify: create new latest version (wechaty#78) * clean file-box * 0.19.18 * 0.20.1 Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * fix: add receiver to room-invitation payload. * Update room-invitation.ts Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * Bump wechaty-puppet version (wechaty#80) * Merge master (#18) * modify: create new latest version (wechaty#78) * clean file-box * 0.19.18 * 0.20.1 Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * Add receiverId to RoomInvitationPayload (#19) * modify: create new latest version (wechaty#78) * clean file-box * 0.19.18 * 0.20.1 * Add receiver to Room Invitation Payload. (wechaty#79) * Merge master (#18) * modify: create new latest version (wechaty#78) * clean file-box * 0.19.18 * 0.20.1 Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * fix: add receiver to room-invitation payload. * Update room-invitation.ts Co-authored-by: Huan (李卓桓) <zixia@zixia.net> Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * 0.20.2 Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * 0.21.0 * BREAKING CHANGE: selfId() might return `undefined` now * 0.21.1 * 0.21.2 * add unknown to scene * 0.21.3 * fix link * rename chatie -> wechaty * 0.21.4 * 0.21.5 * clean enum numbers * `YOU` should only be used inside Puppet system, should not be passed to Wechaty * code clean * restore * 0.21.6 * Event payload abstract (wechaty#86) * Remove unused types in the abstract (wechaty#85) * Use object for all events (on/listen) for better encapsulate (wechaty#81) * use string for internal usage * 0.21.7 * restore XXX_EVENT_DICT * 0.21.8 * add payload for ready event * 0.21.9 * Enable GitHub Actions * 0.21.10 * code clean * 0.21.11 * doc Co-authored-by: Huan LI <zixia@zixia.net> * 0.25.1 * rename event `watchdog` to `heartbeat` (wechaty#88) * 0.23.1 * clear log message * 0.23.2 * reset for start * 0.23.3 * add name() method for getting the provider npm name (wechaty#89) * 0.23.4 * refactor PuppetTest to seprate module directory (wechaty#89) * 0.23.5 * Upgrade state-switch to support Observable * 0.23.6 * Upgrade StateSwitch to support RxJS fromEvent * fix options * 0.23.7 * --skipLibCheck * 0.23.8 * public state for rxjs helper function visit * 0.23.9 * 0.24.0 (wechaty#92) * increase the cache size for RoomMemberPayload from 10K to 30K * 0.23.10 * 0.25.1 Co-authored-by: Huan LI <zixia@zixia.net> * feat: modify friendshipAdd for support add room member be friends * 0.34.2 * fix: conflict bug Co-authored-by: Huan (李卓桓) <zixia@zixia.net> * clean name * 0.34.3 Co-authored-by: Huan (李卓桓) <zixia@zixia.net>
Hi,
Of the different Puppet Providers, how can the wechaty script know which kind of puppet is being used?
The reason I'm asking is that, for all the Emoji cleaning functions in helper-functions/index.ts, they are actually puppet dependent. Knowing which puppet is being used can make the helper-functions generic.
Thanks
The text was updated successfully, but these errors were encountered: