Skip to content
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

RFC : how to support multi-platform message channel ? #2023

Closed
wj-Mcat opened this issue Jul 19, 2020 · 5 comments
Closed

RFC : how to support multi-platform message channel ? #2023

wj-Mcat opened this issue Jul 19, 2020 · 5 comments
Assignees

Comments

@wj-Mcat
Copy link
Contributor

wj-Mcat commented Jul 19, 2020

There days, we got deep into the multi-platform group chat bot documents and find that there are some message types and message payload datastructure which are different from the current message type in wechaty-puppet. In other words, the current wechaty-puppet can support the rich message info in dingtalk, feishu, enterprise wechat. For example, message card is not supported now:

  • feishu message card
{
  "open_chat_id": "oc_1234abcd",
  "msg_type": "interactive",
  "card": {
        "config": {
            "wide_screen_mode": true
        },
        "header": {
            "title": {
                "tag": "plain_text",
                "content": "this is header"
            }
        },
        "elements": [
            {
                "tag": "div",
                "text": {
                    "tag": "plain_text",
                    "content": "This is a very very very very very very very long text;"
                }
            },
            {
                "tag": "action",
                "actions": [
                    {
                        "tag": "button",
                        "text": {
                            "tag": "plain_text",
                            "content": "Read"
                        },
                        "type": "default"
                    }
                ]
            }
        ]
    }
}
  • dingtalk feed card
{
    "feedCard": {
        "links": [
            {
                "title": "时代的火车向前开", 
                "messageURL": "https://www.dingtalk.com/s?__biz=MzA4NjMwMTA2Ng==&mid=2650316842&idx=1&sn=60da3ea2b29f1dcc43a7c8e4a7c97a16&scene=2&srcid=09189AnRJEdIiWVaKltFzNTw&from=timeline&isappinstalled=0&key=&ascene=2&uin=&devicetype=android-23&version=26031933&nettype=WIFI", 
                "picURL": "https://gw.alicdn.com/tfs/TB1ayl9mpYqK1RjSZLeXXbXppXa-170-62.png"
            },
            {
                "title": "时代的火车向前开2", 
                "messageURL": "https://www.dingtalk.com/s?__biz=MzA4NjMwMTA2Ng==&mid=2650316842&idx=1&sn=60da3ea2b29f1dcc43a7c8e4a7c97a16&scene=2&srcid=09189AnRJEdIiWVaKltFzNTw&from=timeline&isappinstalled=0&key=&ascene=2&uin=&devicetype=android-23&version=26031933&nettype=WIFI", 
                "picURL": "https://gw.alicdn.com/tfs/TB1ayl9mpYqK1RjSZLeXXbXppXa-170-62.png"
            }
        ]
    }, 
    "msgtype": "feedCard"
}
  • enterprise wechat rich message
{
    "msgtype": "news",
    "news": {
       "articles" : [
           {
               "title" : "中秋节礼品领取",
               "description" : "今年中秋节公司有豪礼相送",
               "url" : "URL",
               "picurl" : "http://res.mail.qq.com/node/ww/wwopenmng/images/independent/doc/test_pic_msg1.png"
           }
        ]
    }
}

I have list some example message payloads:

So, I think we should add some message types and message payload to support more multi-platform wechaty. How do you think about it ?

@windmemory
Copy link
Member

I would prefer to have several message types that are currently supported by all these three platforms, as Wechaty is targeting a universe chatbot connector, the types that are mostly in common are those types that we want to do first.

From my perspective, I think the AcitonCard(card with option buttons) and FeedCard(card with multiple links inside) are those types that we should go first.

@huan what do you think about these new message types?

@huan
Copy link
Member

huan commented Jul 20, 2020

@wj-Mcat Thank you very much for create this RFC for discussing!

I agree that when we start supporting multi-platform puppet protocols other than Wechaty (like Feishu, DingTalk, etc), the payload might need to be reviewed and we need to find a way for compatible with multi protocols.

@windmemory I fully agree with you that our Wechaqty targeting a universe chatbot connector, and we should have a universe payload for compatible with all IMs, as ActionCard is also needed by the Microsoft BotFramework and the Facebook Messenger.

Please feel free to submit a solution by designing a new payload system for our UrlLink payload (or new payload if necessary), then we will be able to discuss those payloads based on our first version.

P.S. @wj-Mcat I'd like to suggest that we should always post all the requires materials in the issue so that we can read them in one place. for example, your example message payloads can be easy pasted into our issue markdown.

@huan huan added this to Preparing in Puppet Maker via automation Jul 20, 2020
@wj-Mcat
Copy link
Contributor Author

wj-Mcat commented Jul 20, 2020

@huan Yes, I will post all of the mutli-platform detailed message payloads example code at public place. In this discuss, how to support multi-platform message channel ? is a multi-steps for wechaty community. Here is the idea discussed with @windmemory :

  1. First, we should try to run the robot of each platform and look at the data structure inside and analyze the details of each platform.
  2. Second, let's take a look at the similarities and differences among the platforms, discuss them, and develop a generic, larger design for wechaty.
  3. Third, we can then develop it on one of the wechaty language platform, eg: ts-wechaty. Maybe we should modify some of puppet's abstraction layer design, but I thinks this is normal. Once it becomes stable, other multilingual Wechaty can be translated directly.

@huan How do you think about it ?

@huan
Copy link
Member

huan commented Jul 20, 2020

I definitely agree with you guys about all those points.

Please go ahead and let me know if you need my help!

Copy link

dosubot bot commented Nov 16, 2023

Hi, @wj-Mcat! I'm Dosu, and I'm helping the wechaty team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, you proposed adding support for multi-platform message channels in the wechaty-puppet library. You provided examples of different message types and payload data structures from platforms like DingTalk, Feishu, and Enterprise WeChat. There have been discussions among @windmemory, @huan, and yourself on how to implement this support. @huan suggested designing a new payload system for compatibility with all IMs, and you planned to analyze the data structure of each platform and develop a generic design for wechaty.

Before we close this issue, we wanted to check if it is still relevant to the latest version of the wechaty repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your contribution!

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Nov 16, 2023
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 23, 2023
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Nov 23, 2023
Puppet Maker automation moved this from Preparing to Done Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Puppet Maker
  
Done
Development

No branches or pull requests

4 participants