Script archived
This script has been archived by the author. The script may malfunction and the author is no longer maintaining it, so you cannot provide feedback.
Statistics
Total Installs
1.4K
Today's New
+0
User Rating
5.0
Description
Versions4
Ratings3
Permissions
钉钉、微信、PushPlus、Telegram消息推送库
消息推送
声明
请在脚本中加入如下 3 行
// @grant GM_xmlhttpRequest
// @require https://cdn.jsdelivr.net/npm/[email protected]/dist/msg-push.js
// @definition https://cdn.jsdelivr.net/npm/[email protected]/src/types/msg-push.d.ts
支持平台
- 钉钉
- 微信
- PushPlus
- Telegram
使用
let dingtalk = new DingTalk("token", "secret");
let wechat = new Wechat("key");
let center = new MsgCenter([dingtalk, wechat]);
let results = await center.pushMsg({
type: "text",
content: "test",
});
for (const key in results) {
let result = results[key];
expect(result.error()).toEqual("");
expect(result.code()).toEqual(0);
}
// 不同平台发送不同内容
let param = {};
param[wechat.platform()] = {
type: "markdown",
content: "# h1",
};
let results = await center.pushMsg({
type: "text",
content: "test",
param: param,
});
Statistics
Total Installs
1.4K
Today's New
+0
User Rating
5.0
Library Details
This is a library used by userscripts, you can reference it directly in your scripts.
License
Not declared
No license declared — reuse with caution