修复 chronocat 通知成功判断 (#2166)

This commit is contained in:
Bad Child
2023-11-03 17:57:10 +08:00
committed by GitHub
parent 9f6d4943ea
commit 82c9978514
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -590,7 +590,7 @@ export default class NotificationService {
}
private async chronocat() {
const { chronocatURL, chronocatQQ, chronocatToekn } = this.params;
const { chronocatURL, chronocatQQ, chronocatToken } = this.params;
try {
const user_ids = chronocatQQ
.match(/user_id=(\d+)/g)
@@ -602,7 +602,7 @@ export default class NotificationService {
const url = `${chronocatURL}/api/message/send`;
const headers = {
'Content-Type': 'application/json',
Authorization: `Bearer ${chronocatToekn}`,
Authorization: `Bearer ${chronocatToken}`,
};
for (const [chat_type, ids] of [
@@ -633,7 +633,7 @@ export default class NotificationService {
json: data,
headers,
});
if (res.body === 'success') {
if (res.statusCode === 200) {
return true;
} else {
throw new Error(res.body);