wechaty / puppet-official-account

Wechaty Puppet for WeChat Official Account
https://wechaty.js.org/2020/11/06/wechaty-puppet-oa-released-en/
Apache License 2.0
16 stars 7 forks source link

Personal OA Support (add instant reply mode when OA is not register by organization) #1

Closed qhduan closed 4 years ago

qhduan commented 4 years ago

Personal OA only support instant message reply in webhooks

I have add a event and listener in webhooks to reply instantly.

and an Environment tag WECHATY_PUPPET_OA_PERSONAL_MODE to specific running on instant mode.

qhduan commented 4 years ago

1 and 2 's potential solution I think they are good

but the 3's, how about we reply a default response under personal-mode ?

Cause the limitation of personal OA, maybe in this mode, we could assume that developers know the bot have to reply and have to reply under 5s(or 4s), or else a default reply will be throw?

huan commented 4 years ago

Yes, please go ahead to update this PR, and let's merge it first and keep improving it later.

And about 3, I'd like to suggest that:

  1. If timeout in 4s, we just return without any reply
  2. If the bot want to say something to contact but there's already timeout, then our system should emit an Error event so that the developer will be able to know what happened.
qhduan commented 4 years ago

@huan based our discuss, I have updated this pr, please check again

huan commented 4 years ago

Let's merge it and publish as v0.5 so that we can test it in our real environment!