Files
freeplanet_serverside/src/telegram/handlers/userHandler.js
Surya Paolo adf1aac10f - aggiornata la grafica della Home di RISO
- Profilo Completition
- Email Verificata
- Invita un Amico (invio di email)
2025-11-15 19:38:55 +01:00

16 lines
513 B
JavaScript

const { sendMessage, sendPhoto } = require('../api');
const { formatUser, safeExec } = require('../helpers');
const notifyUser = safeExec(async (user, text) => {
if (!user?.telegram_id) return;
const msg = `👋 Ciao ${formatUser(user)}\n${text}`;
await sendMessage(user.telegram_id, msg);
});
const sendUserPhoto = safeExec(async (user, photoUrl, caption) => {
if (!user?.telegram_id) return;
await sendPhoto(user.telegram_id, photoUrl, caption);
});
module.exports = { notifyUser, sendUserPhoto };