@liberstudio/cloudflare-list 2.4.7 → 2.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/attacks.service.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -106,6 +106,7 @@ import { CloudflareAttacksModule } from "@liberstudio/cloudflare-list";
|
|
|
106
106
|
telegramNotify: {
|
|
107
107
|
chatId: config.getOrThrow<string>("TELEGRAM_NOTIFY_CHAT_ID"),
|
|
108
108
|
},
|
|
109
|
+
notifyProvider: config.get<"whatsapp" | "telegram">("NOTIFY_PROVIDER"), // assente → scelta automatica
|
|
109
110
|
}),
|
|
110
111
|
}),
|
|
111
112
|
],
|
|
@@ -156,6 +157,7 @@ Per ricavare il `chatId`: scrivi un messaggio al bot (o aggiungilo al gruppo), p
|
|
|
156
157
|
```env
|
|
157
158
|
TELEGRAM_BOT_TOKEN=123456:ABC-your-bot-token
|
|
158
159
|
TELEGRAM_NOTIFY_CHAT_ID=123456789
|
|
160
|
+
NOTIFY_PROVIDER=telegram # opzionale: whatsapp | telegram
|
|
159
161
|
```
|
|
160
162
|
|
|
161
163
|
### `whatsappNotify` — notifiche ban su WhatsApp
|
package/dist/attacks.service.js
CHANGED
|
@@ -83,7 +83,8 @@ let AttacksService = class AttacksService {
|
|
|
83
83
|
}
|
|
84
84
|
(0, rxjs_1.firstValueFrom)(this.httpService.post(`https://api.telegram.org/bot${token}/sendMessage`, { chat_id: tg.chatId, text: message })).catch((err) => {
|
|
85
85
|
const msg = err instanceof Error ? err.message : "Errore sconosciuto";
|
|
86
|
-
|
|
86
|
+
const description = axios_2.default.isAxiosError(err) ? err.response?.data?.description : undefined;
|
|
87
|
+
this.logger.warn(`Notifica Telegram fallita: ${msg}${description ? ` (${description})` : ""}`);
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
sendWhatsappNotification(message) {
|