feat: notifikasi admin/monitoring via Telegram (WA fallback); alert staff dialihkan ke Telegram
This commit is contained in:
1 parent
52f6be26d1
commit
e838645531
7 files changed
+35
-9
No files matched your search
@@ -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 };
|
||||
Reference in new issue
Block a user