feat: notifikasi admin/monitoring via Telegram (WA fallback); alert staff dialihkan ke Telegram

This commit is contained in:
oxpoe committed 2026-10-09 09:23:06 +07:00
1 parent 52f6be26d1
commit e838645531
7 files changed
+35 -9

No files matched your search

+13 -1
View File
@@ -154,4 +154,16 @@ async function isConnected() {
return val;
}
module.exports = { sendText, sendImage, sendDocument, sendToStaff, isConnected, gateway };
// Notifikasi untuk ADMIN/monitoring → Telegram (utama). WA (sendToStaff) sebagai fallback.
async function notifyAdmin(text) {
try {
const tg = require('./telegramBot');
if (tg && typeof tg.notifyAdmin === 'function') {
const ok = await tg.notifyAdmin(text);
if (ok) return true;
}
} catch (e) {}
return sendToStaff(text);
}
module.exports = { sendText, sendImage, sendDocument, sendToStaff, notifyAdmin, isConnected, gateway };