Skip to content

Conversation

@Soulter
Copy link
Member

@Soulter Soulter commented Feb 9, 2026

dingtalk supports active message

Modifications / 改动点

  • This is NOT a breaking change. / 这不是一个破坏性变更。

Screenshots or Test Results / 运行截图或测试结果

image

Checklist / 检查清单

  • 😊 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。/ If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
  • 👀 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。/ My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
  • 🤓 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到了 requirements.txtpyproject.toml 文件相应位置。/ I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
  • 😮 我的更改没有引入恶意代码。/ My changes do not introduce malicious code.

Summary by Sourcery

记录钉钉适配器在发送主动消息和处理媒体(包括访问令牌使用和媒体上传)方面的能力。

文档内容:

  • 添加关于发送多种钉钉机器人消息类型的详细指南,重点介绍文本(Markdown)和图片消息。
  • 添加关于通过媒体上传 API 将图片上传到钉钉以获取 media_id 的文档。
  • 记录在使用钉钉集成时,如何从适配器客户端获取访问令牌(access token)。
Original summary in English

Summary by Sourcery

Document Dingtalk adapter capabilities for sending active messages and handling media, including access token usage and media upload.

Documentation:

  • Add detailed guide for sending various Dingtalk robot message types, focusing on text (Markdown) and image messages.
  • Add documentation for uploading images to Dingtalk to obtain media_id via the media upload API.
  • Document how to obtain access tokens from the adapter client when working with the Dingtalk integration.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Feb 9, 2026
@dosubot
Copy link

dosubot bot commented Feb 9, 2026

Related Documentation

Checked 1 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@Soulter Soulter changed the title feat: enhance Dingtalk adapter with message handling and media processing improvements feat: enhance Dingtalk adapter with active push message and image, video, audio message type Feb 9, 2026
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - 我发现了 2 个安全问题和 1 个其他问题,并留下了一些整体性的反馈:

安全问题

  • 检测到一个通用 API Key,可能会暴露对多种服务和敏感操作的访问权限。(link)
  • 检测到一个通用 API Key,可能会暴露对多种服务和敏感操作的访问权限。(link)

总体评论

  • send_message.md 中的部分 JSON/代码示例看起来被截断或语法无效(例如缺少右花括号、字段在结构中途被切断);建议修复这些示例,使其可以直接复制粘贴并运行。
  • 示例负载和 curl 命令中包含具体的 ID/token 以及看起来很真实的标识符;请将它们替换为明显虚构的占位符,以避免造成混淆并防止潜在的敏感数据泄露。
给 AI Agent 的提示
Please address the comments from this code review:

## Overall Comments
- Several of the JSON/code examples in `send_message.md` appear truncated or syntactically invalid (e.g., missing closing braces and fields cut off mid-structure); it would be good to fix these so they can be copy-pasted and executed directly.
- The example payloads and curl commands include concrete IDs/tokens and realistic-looking identifiers; please replace these with clearly fake placeholders to avoid confusion and any potential leakage of sensitive data.

## Individual Comments

### Comment 1
<location> `astrbot/core/platform/sources/dingtalk/send_message.md:7` </location>
<code_context>
+
+
+
+## Friendmessage
+
+需要 access token
</code_context>

<issue_to_address>
**suggestion (typo):** 小节标题“Friendmessage”可能是大小写不一致的拼写问题。

如果不是特定术语,建议统一为更清晰的形式,比如“FriendMessage”,或改成与“groupmessage”风格一致,方便识别和搜索。

```suggestion
## FriendMessage
```
</issue_to_address>

### Comment 2
<location> `astrbot/core/platform/sources/dingtalk/send_message.md:14` </location>
<code_context>
f32aaf78350a3160b4e69ed3e3053c36
</code_context>

<issue_to_address>
**security (generic-api-key):** 检测到一个通用 API Key,可能会暴露对多种服务和敏感操作的访问权限。

*来源:gitleaks*
</issue_to_address>

### Comment 3
<location> `astrbot/core/platform/sources/dingtalk/send_message.md:24` </location>
<code_context>
f32aaf78350a3160b4e69ed3e3053c36
</code_context>

<issue_to_address>
**security (generic-api-key):** 检测到一个通用 API Key,可能会暴露对多种服务和敏感操作的访问权限。

*来源:gitleaks*
</issue_to_address>

Sourcery 对开源项目免费——如果你觉得我们的代码审查有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据这些反馈改进后续的代码审查。
Original comment in English

Hey - I've found 2 security issues, 1 other issue, and left some high level feedback:

Security issues:

  • Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (link)
  • Detected a Generic API Key, potentially exposing access to various services and sensitive operations. (link)

General comments:

  • Several of the JSON/code examples in send_message.md appear truncated or syntactically invalid (e.g., missing closing braces and fields cut off mid-structure); it would be good to fix these so they can be copy-pasted and executed directly.
  • The example payloads and curl commands include concrete IDs/tokens and realistic-looking identifiers; please replace these with clearly fake placeholders to avoid confusion and any potential leakage of sensitive data.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Several of the JSON/code examples in `send_message.md` appear truncated or syntactically invalid (e.g., missing closing braces and fields cut off mid-structure); it would be good to fix these so they can be copy-pasted and executed directly.
- The example payloads and curl commands include concrete IDs/tokens and realistic-looking identifiers; please replace these with clearly fake placeholders to avoid confusion and any potential leakage of sensitive data.

## Individual Comments

### Comment 1
<location> `astrbot/core/platform/sources/dingtalk/send_message.md:7` </location>
<code_context>
+
+
+
+## Friendmessage
+
+需要 access token
</code_context>

<issue_to_address>
**suggestion (typo):** 小节标题“Friendmessage”可能是大小写不一致的拼写问题。

如果不是特定术语,建议统一为更清晰的形式,比如“FriendMessage”,或改成与“groupmessage”风格一致,方便识别和搜索。

```suggestion
## FriendMessage
```
</issue_to_address>

### Comment 2
<location> `astrbot/core/platform/sources/dingtalk/send_message.md:14` </location>
<code_context>
f32aaf78350a3160b4e69ed3e3053c36
</code_context>

<issue_to_address>
**security (generic-api-key):** Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

*Source: gitleaks*
</issue_to_address>

### Comment 3
<location> `astrbot/core/platform/sources/dingtalk/send_message.md:24` </location>
<code_context>
f32aaf78350a3160b4e69ed3e3053c36
</code_context>

<issue_to_address>
**security (generic-api-key):** Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

*Source: gitleaks*
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Soulter Soulter force-pushed the feat/dingtalk-active-send branch from d297155 to fe49b25 Compare February 9, 2026 07:10
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. area:platform The bug / feature is about IM platform adapter, such as QQ, Lark, Telegram, WebChat and so on. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Feb 9, 2026
@Soulter Soulter merged commit 06b2c7c into master Feb 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:platform The bug / feature is about IM platform adapter, such as QQ, Lark, Telegram, WebChat and so on. size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant