Update notify.ts

This commit is contained in:
Appoip 2022-09-03 19:56:11 +08:00 committed by GitHub
parent e61c0e1fb5
commit cd75afe793
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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')) {