@wx-sab/ding-talk-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

钉钉机器人消息发送

Install

npm install @wx-sab/ding-bot-sdk

Features

  • [x] 仅支持加签机器人
  • [x] 支持所有类型消息

Usage

import DingBot from '@wx-sab/ding-bot-sdk'

const dingBot = new DingBot({
  // 机器人密钥
  BOT_SECRET: string,
  ACCESS_TOKEN: string,
  BASE_URL?: string
})

dingBot.sendNotify({
  msgtype: string,
  at?: {
    atMobiles?: Array<string>,
    atUserIds?: Array<string>,
    isAtAll?: boolean
  },
  // 文本类型
  text?: {
    content: string,
  },
  // 链接类型
  link?: {
    text: string,
    title: string,
    picUrl?: string,
    messageUrl: string
  },
  // Markdown 类型
  markdown?: {
    title: string,
    text: string
  },
  // ActionCard 类型
  actionCard?: {
    title: string,
    text: string,
    btnOrientation?: string,
    singleTitle?: string,
    singleURL?: string,
    btns?: Array<actionCardBtns>,
  },
  // FeedCard 类型
  feedCard?: {
    links: Array<feedCardLinks>
  }
})

Readme

Keywords

none

Package Sidebar

Install

npm i @wx-sab/ding-talk-sdk

Weekly Downloads

1

Version

1.0.4

License

ISC

Unpacked Size

5.02 kB

Total Files

5

Last publish

Collaborators

  • luanmeng
  • zprial