RFC : how to support multi-platform message channel ?
Created by: wj-Mcat
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 ?