diff --git a/back/services/notify.ts b/back/services/notify.ts index fac042be..986515dd 100644 --- a/back/services/notify.ts +++ b/back/services/notify.ts @@ -17,6 +17,7 @@ export default class NotificationService { ['goCqHttpBot', this.goCqHttpBot], ['serverChan', this.serverChan], ['pushDeer', this.pushDeer], + ['chat', this.chat], ['bark', this.bark], ['telegramBot', this.telegramBot], ['dingtalkBot', this.dingtalkBot], @@ -135,6 +136,22 @@ export default class NotificationService { ); } + private async chat() { + const { chatUrl, chattoken } = this.params; + const url = `${chatUrl}${chatUrl}`; + const res: any = await got + .post(url, { + timeout: this.timeout, + retry: 0, + body: `payload={"text":"${this.title}"}`, + headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + }) + .json(); + return ( + res.success + ); + } + private async bark() { let { barkPush, barkIcon, barkSound, barkGroup } = this.params; if (!barkPush.startsWith('http') && !barkPush.startsWith('https')) {