npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@moltcloud/dingtalk-plugin

v0.1.0

Published

钉钉 (DingTalk) channel plugin for Moltbot

Readme

@moltcloud/dingtalk-plugin

钉钉 (DingTalk) 渠道插件 for Moltbot

功能特点

  • Stream 模式:使用 WebSocket 长连接,无需公网 IP 和域名备案
  • 单聊/群聊:支持单聊对话和群聊 @ 机器人
  • 消息类型:支持文本、Markdown、ActionCard 等消息格式
  • 自动重连:断线自动重连,保持稳定连接

安装

npm install @moltcloud/dingtalk-plugin

配置

moltbot.json 中添加:

{
  "plugins": {
    "entries": {
      "dingtalk": { "enabled": true }
    }
  },
  "channels": {
    "dingtalk": {
      "enabled": true,
      "clientId": "your-app-key",
      "clientSecret": "your-app-secret",
      "agentId": "your-agent-id",
      "robotCode": "your-robot-code"
    }
  }
}

配置参数说明

| 参数 | 必填 | 说明 | |------|------|------| | clientId | ✅ | 钉钉应用 AppKey | | clientSecret | ✅ | 钉钉应用 AppSecret | | agentId | ❌ | 应用 Agent ID | | robotCode | ❌ | 机器人 Code(主动发送单聊消息需要) |

获取凭证

  1. 访问 钉钉开放平台
  2. 创建「企业内部应用」
  3. 在「凭证与基础信息」中获取 AppKeyAppSecret
  4. 在「机器人与消息推送」中:
    • 启用「机器人」功能
    • 消息接收模式选择「Stream 模式
  5. 在「开发管理」中获取 Agent ID

Stream 模式优势

相比传统 Webhook 模式,Stream 模式具有以下优势:

| 特性 | Webhook | Stream | |------|---------|--------| | 需要公网 IP | ✅ | ❌ | | 需要域名备案 | ✅ | ❌ | | 需要配置回调 URL | ✅ | ❌ | | 开发调试 | 需要内网穿透 | 本地直接连接 | | 稳定性 | 依赖服务器 | 自动重连 |

消息类型支持

入站(接收)

  • 文本消息
  • 图片消息
  • 文件消息

出站(发送)

  • 文本消息
  • Markdown 消息
  • ActionCard 消息(按钮卡片)

开发

# 安装依赖
npm install

# 编译
npm run build

# 监听模式
npm run dev

发布更新

cd extensions/dingtalk

# 修改版本号
npm version patch   # 0.1.0 → 0.1.1(小修复)
npm version minor   # 0.1.0 → 0.2.0(新功能)
npm version major   # 0.1.0 → 1.0.0(重大更新)

# 发布
npm publish --access public

许可证

MIT