wechaty / puppet-whatsapp

Wechaty Puppet for Whatsapp
https://npmjs.com/package/wechaty-puppet-whatsapp
Apache License 2.0
24 stars 17 forks source link

Refactor whatsapp event #258

Closed su-chang closed 2 years ago

su-chang commented 2 years ago

Related comments: https://github.com/wechaty/puppet-whatsapp/pull/256#issuecomment-1046786919

bung87 commented 2 years ago

I think you only need extends base class when need access base class properties, others class just`implements MessageEvent` or other XxxEvent

su-chang commented 2 years ago

I think you only need extends base class when need access base class properties, others class just`implements MessageEvent` or other XxxEvent

But all sub-classes should extend base class due to they need call methods which in this.manager and need get the id by getBotId().

So that is the reason of my design:

Please share your mind to me, thank you. @bung87 @hcfw007

bung87 commented 2 years ago

I double checked , they all need emit , this.manager , so that make sense.