@wx-sab/ding-talk-sdk
v1.0.4
Published
``` npm install @wx-sab/ding-bot-sdk ``` ### Features - [x] 仅支持加签机器人 - [x] 支持所有类型消息
Downloads
8
Readme
钉钉机器人消息发送
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>
}
})