You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above issue is because the Wechaty Chatopera Plugin will use the message.say() to send back the message, and when we have two Wechaty instances in HA, the message will be processed twice.
awaitmessage.say(answer)
We need to figure out a way to deal with this situation and make it the best practice.
Deduplication
One message will be received by more than one bot with HA Wechaty, which means it will be emitted many times. However, we only want HA Wechaty to emit one message for one message, not many.
When we are using plugin with HAWechaty, we will register the plugin to all the underlying Wechaty instances:
https://github.com/wechaty/ha-wechaty/blob/eb47c40bd59802beac388e4f288b3a7ab0222b8e/src/ha-wechaty.ts#L338-L344
Which means that, all the available plugin will react to the messages, lead to the below issue
The above issue is because the Wechaty Chatopera Plugin will use the
message.say()
to send back the message, and when we have two Wechaty instances in HA, the message will be processed twice.We need to figure out a way to deal with this situation and make it the best practice.
Deduplication
One message will be received by more than one bot with HA Wechaty, which means it will be emitted many times. However, we only want HA Wechaty to emit one message for one message, not many.
Even the text message will not match each other when the bot is using different puppet protocols:
The above message comes from PadLocal and Paimon.
See: kaiyuanshe/osschat#178
The text was updated successfully, but these errors were encountered: