Click per mandare un messaggio al Destinatario dei RIS, se non è entrato ancora in RIS ITALIA.

This commit is contained in:
Surya Paolo
2023-11-19 23:40:38 +01:00
parent 045057082c
commit d434374ed9
8 changed files with 205 additions and 6 deletions

View File

@@ -760,6 +760,11 @@ const MyTelegramBot = {
return FormDaMostrare;
},
getclTelegByidapp: function (idapp) {
const cl = getclTelegByidapp(idapp);
return cl;
},
getCiao: function (idapp, username, lang) {
return tools.gettranslate('CIAO', lang) + ' ' + username + '!\n';
},
@@ -834,8 +839,13 @@ const MyTelegramBot = {
const langdest = myuser.lang;
const telegid = myuser.profile.teleg_id;
let userrecDest = await User.getUserShortDataByUsername(idapp, userDest);
let userId = userrecDest._id;
let title = this.getNomeAppByIdApp(idapp);
let keyb = null;
let domanda = '';
let send_notif = false;
let actions = [];
const struserinfomsg = tools.getUserInfoMsg(idapp, myuser);
@@ -913,7 +923,7 @@ const MyTelegramBot = {
} else {
domanda = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY', locale: langdest }, myuser.username, name) + '<br>' + struserinfomsg;
keyb = cl.getInlineKeyboard(myuser.lang, [
const keyb = cl.getInlineKeyboard(myuser.lang, [
{
text: '✅ Abilita fido a ' + myuser.username,
callback_data: InlineConferma.RISPOSTA_SI + myfunc + tools.SEP + myuser.username + tools.SEP + '' + tools.SEP + '' + tools.SEP +
@@ -928,6 +938,11 @@ const MyTelegramBot = {
}
}
if (send_notif) {
// SEND PUSH NOTIFICATION
await this.sendNotificationToUser(userId, title, descr, openUrl, '', tag, actions);
}
// Invia Msg
if (domanda) {
const teleg_id = await User.TelegIdByUsername(idapp, userDest);
@@ -4288,6 +4303,10 @@ if (true) {
}
}
} else if (data.action === InlineConferma.RISPOSTA_SI + shared_consts.CallFunz.ENTRA_RIS_ITALIA) {
url = '';
bot.answerCallbackQuery(callbackQuery.id, { url });
}
}
} catch (e) {