0.2.2: 消息推送插件化重构 + 14通道 + 多用户推送 + 全局推送 + 事件模板自定义 + 每日报告 + 变量说明

This commit is contained in:
2026-05-16 17:25:29 +08:00
parent e38adee8ff
commit ab52ca2e69
30 changed files with 1638 additions and 326 deletions

View File

@@ -0,0 +1,27 @@
import { Notifier, NotifyParams, NotifyResult, NotifierParam } from './notifier.types';
const params: NotifierParam[] = [
{ key: 'sendkey', label: 'SendKey', type: 'password', required: true, placeholder: 'Server酱 Turbo SendKey' },
{ key: 'title', label: '标题', type: 'text', default: 'CloudSearch', required: false },
{ key: 'content', label: '内容', type: 'text', required: true },
];
export const serverchanturboNotifier: Notifier = {
name: 'serverchanturbo',
label: 'Server酱 Turbo',
params,
async notify(params: NotifyParams): Promise<NotifyResult> {
try {
const resp = await fetch(`https://sctapi.ftqq.com/${params.sendkey}.send`, {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: new URLSearchParams({ title: params.title || 'CloudSearch', desp: params.content || '' }).toString(),
});
const data: any = await resp.json();
if (data.code === 0) return { success: true, message: 'Server酱 Turbo 推送成功' };
return { success: false, message: data.message || `HTTP ${resp.status}` };
} catch (err: any) {
return { success: false, message: err.message };
}
},
};