The dingtalk module allows users to send text, markdown, and rich text card messages to DingTalk groups via bot webhooks.
When to Activate
- When sending automated build or status notifications to a DingTalk group.
- When using Markdown for formatted alerts (titles, lists, bold text).
- When creating interactive action cards with links and images.
Core Principles & Rules
- Webhook Required: Set the bot
webhookurl viainitor--cfg. - Markdown Support: Use
--markdownfor styled messages. - Card Messages: Use
--richtextand--cardfor complex interactive layouts.
Patterns & Examples
Send Markdown
# Send a styled markdown notification to DingTalk
x dingtalk send --markdown --title "Release Note" "## Version v1.0.0\n- Bug fixes\n- New features"
Send Action Card
# Send a rich text card with a link and an image
x dingtalk send --richtext --card "View Details" "https://x-cmd.com" "https://example.com/image.png"
Checklist
- Ensure the DingTalk webhook URL is configured.
- Verify the message format (text/markdown/card) suits the content.