Skip to content

Commit 189d6d5

Browse files
committed
bots/gsc-report: update
1 parent 27143cf commit 189d6d5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

bots/gsc-report/main.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ async function getSearchPerformance() {
4747
}
4848

4949
async function sendToDiscord(data) {
50-
const webhook = new WebhookClient({ url: process.env.WEBHOOK_URL });
50+
const url = process.env.WEBHOOK_URL;
51+
if (!url) {
52+
throw new Error('WEBHOOK_URL environment variable is not set');
53+
}
54+
const webhook = new WebhookClient({ url });
5155

5256
const fields = Object.entries(data)
5357
.filter(([sub, stats]) => stats.clicks > 0)

0 commit comments

Comments
 (0)