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

新的菜单交互 #277

Open
lloydzhou opened this issue Jul 13, 2023 · 3 comments
Open

新的菜单交互 #277

lloydzhou opened this issue Jul 13, 2023 · 3 comments
Labels
enhancement New feature or request feature 钉钉 与钉钉相关的issue

Comments

@lloydzhou
Copy link

lloydzhou commented Jul 13, 2023

新的菜单交互

  1. 使用新的菜单交互(如下图所示)
  2. 每一个按钮,都是可点击的,点击后自动回复对应的文字

#126
@eryajf

20230713-155423

@lloydzhou lloydzhou added the question Further information is requested label Jul 13, 2023
@eryajf
Copy link
Owner

eryajf commented Jul 13, 2023

有没有相关的文档,或者欢迎直接提交pr

@lloydzhou
Copy link
Author

@eryajf

独立跳转型ActionCard,支持卡片底部多个按钮

文档地址

https://open.dingtalk.com/document/orgapp/custom-robots-send-group-messages

image

底部按钮配置

actionURL支持配置成dtmd链接

文档地址

https://open.dingtalk.com/document/isvapp/the-internal-robot-of-the-enterprise-realizes-the-interaction-in

image

这个文档里面也有提到dtmdlink相关的信息

https://open.dingtalk.com/document/isvapp/lightweight-access-document-of-interactive-cards#title-8il-1hb-ywm

image

@lloydzhou
Copy link
Author

lloydzhou commented Jul 13, 2023

@eryajf

示例

这里是一个使用官方样例格式化出来的json示例
这个actionCard类型的消息,可以通过自建机器人的webhook,或者通过自定义机器人的那种固定回调,都能正常发送

{
  'msgtype': 'actionCard',
  'actionCard': {
    'title': '我 20 年前想打造一间苹果咖啡厅,而它正是 Apple Store 的前身',
    'text': '![screenshot](https://img.alicdn.com/tfs/TB1NwmBEL9TBuNjy1zbXXXpepXa-2400-1218.png) \n\n #### 乔布斯 20 年前想打造的苹果咖啡厅 \n\n Apple Store 的设计正从原来满满的科技感走向生活化,而其生活化的走向其实可以追溯到 20 年前苹果一个建立咖啡馆的计划',
    'btnOrientation': '0',
    'btns': [{
      'actionURL': 'dtmd://dingtalkclient/sendMessage?content=内容不错',
      'title': '内容不错'
    },
    {
      'actionURL': 'dtmd://dingtalkclient/sendMessage?content=不感兴趣',
      'title': '不感兴趣'
    }]
  }
}

python demo

https://gist.github.com/lloydzhou/e2fd09a1aab49d163562727f706d4160

发送消息结果

img_v2_58b37cb6-9d7d-407e-948f-f8c63b40e78g

@lloydzhou lloydzhou added enhancement New feature or request feature 钉钉 与钉钉相关的issue and removed question Further information is requested labels Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature 钉钉 与钉钉相关的issue
Projects
None yet
Development

No branches or pull requests

2 participants