wechaty / puppet-padlocal

Puppet PadLocal is a Pad Protocol for WeChat
https://wechaty.js.org/docs/puppet-providers/padlocal
Apache License 2.0
642 stars 88 forks source link

`messageForward` can not forward text with ":\n" correctly. #91

Closed huan closed 2 years ago

huan commented 3 years ago

Our Friday BOT will use message.forward() to forward messages between the developers room on WeChat using the RoomConnector Wechaty Plugin.

Problem

If we have the following text:

For the discussions this afternoon about open-source questions, I'd like to summarize some facts below:

1. Wechaty SDK is open source, see https://wechaty.js.org/docs/polyglot/
2. Wechaty builds on top of the Wechaty Puppet Abstraction, see https://wechaty.js.org/docs/specs/puppet
3. By following the Wechaty Puppet design, Wechaty is very flexiable to work with any IM (like whatsapp, wechat, 5g-rcs, etc), most of them are open-source, see https://wechaty.js.org/docs/puppet-providers/
4. Wechaty has a gRPC standarized interface to make a Wechaty Puppet Service, most of the servics are provided by the 3rd party from the community, and most of them are close-source, see https://wechaty.js.org/docs/puppet-services/
5. The Wechaty Ecosystem is a framework to make all of the above components work together to help developers to use Wechaty for building a chatbot with ease.

So in a summary, when you are saying whether Wechaty is open-source or close-source, at the same time, you must say which component you are talking about specificly.

There are existing full open-source solutions based on Wechaty, like UOS(web protocol) & XP(windows protocol), as well as half close-source solusions based on Puppet Services like WXWork or PadLocal.

The forwarded message will be only as the following:

[Huan@Developers' Headquarters]: For the discussions this afternoon about open-source questions, I'd like to summarize some facts below

image

Solution

It seems that all the text after the :\n has been discarded.

If I get rid of the :\n in the original text, then it can be forwarded correctly:

For the discussions this afternoon about open-source questions, I'd like to summarize some facts below

1. Wechaty SDK is open source, see https://wechaty.js.org/docs/polyglot/
2. Wechaty builds on top of the Wechaty Puppet Abstraction, see https://wechaty.js.org/docs/specs/puppet
3. By following the Wechaty Puppet design, Wechaty is very flexiable to work with any IM (like whatsapp, wechat, 5g-rcs, etc), most of them are open-source, see https://wechaty.js.org/docs/puppet-providers/
4. Wechaty has a gRPC standarized interface to make a Wechaty Puppet Service, most of the servics are provided by the 3rd party from the community, and most of them are close-source, see https://wechaty.js.org/docs/puppet-services/
5. The Wechaty Ecosystem is a framework to make all of the above components work together to help developers to use Wechaty for building a chatbot with ease.

So in a summary, when you are saying whether Wechaty is open-source or close-source, at the same time, you must say which component you are talking about specificly.

There are existing full open-source solutions based on Wechaty, like UOS(web protocol) & XP(windows protocol), as well as half close-source solusions based on Puppet Services like WXWork or PadLocal.

Diff: removing the trailing :

- For the discussions this afternoon about open-source questions, I'd like to summarize some facts below:
+ For the discussions this afternoon about open-source questions, I'd like to summarize some facts below

Conclusion

There must have some bug in the code that need to be check when dealing with the :\n.

huan commented 3 years ago

The original message

image

The forwarded message

image

Diff

- :
- https://cloud.google.com/apis/design