feishumessager
v2.0.3
Published
### 支持推送类型 * 群机器人卡片消息推送 * 自建应用卡片推送
Readme
飞书消息推送
支持推送类型
- 群机器人卡片消息推送
- 自建应用卡片推送
安装方式
npm i feishumessager使用示例
import { FeiShuInteractiveMsgOperator } from "feishumessager";
// 简单的群推送
await FeiShuInteractiveMsgOperator.sendMsg({
token:'群机器人token',
// 传 string[]自动换行, 传string需调用者自行组装\n 来换行
content:[
'**加粗字体**',
'<font color="red">红色字体</font>'
]
})
// 简单的群推送,@所有人
await FeiShuInteractiveMsgOperator.sendMsg({
token:'群机器人token',
// 传 string[]自动换行, 传string需调用者自行组装\n 来换行
content:[
'**加粗字体**',
'<font color="red">红色字体</font>'
],
isAtAll: true
})
// 通过邮件@群用户
await FeiShuInteractiveMsgOperator.sendMsgAtEmail({
token:'群机器人token',
// 传 string[]自动换行, 传string需调用者自行组装\n 来换行
content:[
'**加粗字体**',
'<font color="red">红色字体</font>'
],
atUserEmails: ["[email protected]"],
feishuProxyUrl: "https://xxxx.com",
ezAppConfig: {
name: "xxx",
appId: "xxxxxxx",
appSecret: "xxxxxxxxxxxx-xxxxxxxx",
jwtKey: "xxxxx"
}
})
// 推送应用消息给指定的人邮箱
await FeiShuAppMsgOperator.sendMsg({
// 传 string[]自动换行, 传string需调用者自行组装\n 来换行
content:[
'**加粗字体**',
'<font color="red">红色字体</font>'
],
UserEmails: ["[email protected]"],
feishuProxyUrl: "https://xxxx.com",
ezAppConfig: {
name: "xxx",
appId: "xxxxxxx",
appSecret: "xxxxxxxxxxxx-xxxxxxxx",
jwtKey: "xxxxx"
}
})