- aggiornata la grafica della Home di RISO
- Profilo Completition - Email Verificata - Invita un Amico (invio di email)
This commit is contained in:
15
src/telegram/handlers/userHandler.js
Normal file
15
src/telegram/handlers/userHandler.js
Normal file
@@ -0,0 +1,15 @@
|
||||
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 };
|
||||
Reference in New Issue
Block a user