Discord webhook notifications

Fixes #46
This commit is contained in:
mrrfv
2023-11-08 22:42:02 +01:00
parent 034decc43d
commit e552a8730f
8 changed files with 72 additions and 1 deletions
+5
View File
@@ -4,6 +4,7 @@ import {
getZeroTrustLists,
} from "./lib/api.js";
import { FAST_MODE } from "./lib/constants.js";
import { notifyWebhook } from "./lib/helpers.js";
(async () => {
const { result: lists } = await getZeroTrustLists();
@@ -32,8 +33,12 @@ import { FAST_MODE } from "./lib/constants.js";
if (FAST_MODE) {
await deleteZeroTrustListsAtOnce(cgpsLists);
// TODO: make this less repetitive
await notifyWebhook(`CF List Delete script finished running (${cgpsLists.length} lists)`);
return;
}
await deleteZeroTrustListsOneByOne(cgpsLists);
await notifyWebhook(`CF List Delete script finished running (${cgpsLists.length} lists)`);
})();