28 lines
962 B
JavaScript
28 lines
962 B
JavaScript
// telegram/handlers/zoomHandler.js
|
|
const shared_consts = require('../../tools/shared_nodejs');
|
|
const { User } = require('../../models/user');
|
|
|
|
const InlineConferma = { RISPOSTA_SI: 'SI_', RISPOSTA_NO: 'NO_' };
|
|
|
|
async function handleZoom({ bot, cl, idapp, msg, data, user, userDest, username_action }) {
|
|
let notifyText = '';
|
|
|
|
if (data.action === InlineConferma.RISPOSTA_SI + shared_consts.CallFunz.REGISTRATION_TOZOOM) {
|
|
// nelle tue callback originale: conferma registrazione + messaggio
|
|
await User.setVerifiedReg(idapp, data.username, data.userDest);
|
|
await cl.sendMsg(msg.chat.id, '🟢 Accesso Zoom confermato!');
|
|
notifyText = 'Zoom OK';
|
|
return notifyText;
|
|
}
|
|
|
|
if (data.action === InlineConferma.RISPOSTA_NO + shared_consts.CallFunz.REGISTRATION_TOZOOM) {
|
|
await cl.sendMsg(msg.chat.id, '🚫 Accesso Zoom rifiutato.');
|
|
notifyText = 'Rifiutato';
|
|
return notifyText;
|
|
}
|
|
|
|
return 'OK';
|
|
}
|
|
|
|
module.exports = { handleZoom };
|