Versione 1.0.21 - RIS ITALIA
This commit is contained in:
@@ -837,19 +837,24 @@ const MyTelegramBot = {
|
||||
const cl = getclTelegByidapp(idapp);
|
||||
if (!cl)
|
||||
return false;
|
||||
|
||||
|
||||
|
||||
const langdest = myuser.lang;
|
||||
const telegid = myuser.profile.teleg_id;
|
||||
|
||||
|
||||
if (!userDest) {
|
||||
userDest = myuser.username;
|
||||
}
|
||||
let userrecDest = await User.getUserShortDataByUsername(idapp, userDest);
|
||||
let userId = userrecDest._id;
|
||||
let title = this.getNomeAppByIdApp(idapp);
|
||||
let title = tools.getNomeAppByIdApp(idapp);
|
||||
let keyb = null;
|
||||
let openUrl = '';
|
||||
let domanda = '';
|
||||
let msg_notifpush = '';
|
||||
let send_notif = false;
|
||||
let actions = [];
|
||||
let tag = '';
|
||||
|
||||
const struserinfomsg = tools.getUserInfoMsg(idapp, myuser);
|
||||
|
||||
@@ -880,6 +885,7 @@ const MyTelegramBot = {
|
||||
await setVerifiedReg(myuser.idapp, myuser.lang, myuser.username, userDest);
|
||||
} else {
|
||||
|
||||
msg_notifpush = getstr(langdest, 'MSG_APORTADOR_ASK_CONFIRM', myuser.username);
|
||||
domanda = getstr(langdest, 'MSG_APORTADOR_ASK_CONFIRM', myuser.username) + '<br>' + struserinfomsg;
|
||||
|
||||
keyb = cl.getInlineKeyboard(myuser.lang, [
|
||||
@@ -897,6 +903,7 @@ const MyTelegramBot = {
|
||||
|
||||
} else if (myfunc === shared_consts.CallFunz.RICHIESTA_GRUPPO) {
|
||||
|
||||
msg_notifpush = printf(getstr(langdest, 'MSG_ACCEPT_NEWENTRY_INGROUP'), name);
|
||||
domanda = printf(getstr(langdest, 'MSG_ACCEPT_NEWENTRY_INGROUP'), name) + '<br>' + struserinfomsg;
|
||||
|
||||
keyb = cl.getInlineKeyboard(myuser.lang, [
|
||||
@@ -912,6 +919,7 @@ const MyTelegramBot = {
|
||||
} else if (myfunc === shared_consts.CallFunz.RICHIESTA_FIDO) {
|
||||
|
||||
if (groupname) {
|
||||
msg_notifpush = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY_BYGROUP', locale: langdest }, groupname);
|
||||
domanda = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY_BYGROUP', locale: langdest }, groupname) + '<br>' + struserinfomsg;
|
||||
|
||||
keyb = cl.getInlineKeyboard(myuser.lang, [
|
||||
@@ -929,9 +937,10 @@ const MyTelegramBot = {
|
||||
send_notif = true;
|
||||
|
||||
} else {
|
||||
msg_notifpush = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY', locale: langdest }, myuser.username, name);
|
||||
domanda = i18n.__({ phrase: 'CIRCUIT_ACCEPT_NEWENTRY', locale: langdest }, myuser.username, name) + '<br>' + struserinfomsg;
|
||||
|
||||
const keyb = cl.getInlineKeyboard(myuser.lang, [
|
||||
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 +
|
||||
@@ -947,17 +956,18 @@ 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);
|
||||
await this.local_sendMsgTelegramByIdTelegram(idapp, teleg_id, domanda, undefined, undefined, true, keyb);
|
||||
}
|
||||
|
||||
if (send_notif && msg_notifpush) {
|
||||
// SEND PUSH NOTIFICATION
|
||||
await tools.sendNotificationToUser(userId, title, msg_notifpush, openUrl, '', tag, actions);
|
||||
}
|
||||
|
||||
|
||||
} catch (e) {
|
||||
console.error('Error askConfirmationUser', e);
|
||||
}
|
||||
@@ -4313,9 +4323,9 @@ if (true) {
|
||||
}
|
||||
}
|
||||
} else if (data.action === InlineConferma.RISPOSTA_SI + shared_consts.CallFunz.ENTRA_RIS_ITALIA) {
|
||||
|
||||
|
||||
url = '';
|
||||
bot.answerCallbackQuery(callbackQuery.id, { url });
|
||||
bot.answerCallbackQuery(callbackQuery.id, { url });
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user