Pagina con i link dei Canali territoriali di RISO
Lista Tabelle "Aggiungi" da errore userId... Aggiunto "Servizi" e alcune sue sottocategorie Aggiunto anche la conversione della foto piccola alla Foto Profilo
This commit is contained in:
@@ -86,6 +86,24 @@ MsgTemplateSchema.statics.getMsgByLang = async function (idapp, typemsg, lang) {
|
||||
|
||||
return { body: '', title: '' };
|
||||
|
||||
};
|
||||
|
||||
MsgTemplateSchema.statics.getMsgByTitleAndLang = async function (idapp, title, lang) {
|
||||
const MsgTemplate = this;
|
||||
|
||||
try {
|
||||
const mymsg = await MsgTemplate.findOne({ idapp, title });
|
||||
if (!!mymsg) {
|
||||
if ((!!mymsg["msg_" + lang]) && (!!mymsg["title_" + lang])) {
|
||||
return { body: mymsg["msg_" + lang], title: mymsg["title_" + lang] }
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
return { body: '', title: '' };
|
||||
}
|
||||
|
||||
return { body: '', title: '' };
|
||||
|
||||
};
|
||||
MsgTemplateSchema.statics.findAllIdApp = async function (idapp) {
|
||||
const MsgTemplate = this;
|
||||
|
||||
@@ -21,14 +21,20 @@ const ProvinceSchema = new Schema({
|
||||
_id: {
|
||||
type: Number,
|
||||
},
|
||||
reg: {
|
||||
type: String,
|
||||
},
|
||||
prov: {
|
||||
type: String,
|
||||
unique: true,
|
||||
// unique: true,
|
||||
maxlength: 3,
|
||||
},
|
||||
descr: {
|
||||
type: String,
|
||||
},
|
||||
link_grp: {
|
||||
type: String,
|
||||
},
|
||||
}, { _id : false });
|
||||
|
||||
|
||||
@@ -75,7 +81,7 @@ ProvinceSchema.statics.executeQueryPickup = async function(idapp, params) {
|
||||
ProvinceSchema.statics.findAllIdApp = async function(idapp) {
|
||||
const myfind = {};
|
||||
|
||||
return Province.find(myfind);
|
||||
return Province.find(myfind).sort({reg: 1, prov: 1});
|
||||
};
|
||||
|
||||
const Province = mongoose.model('Province', ProvinceSchema);
|
||||
|
||||
@@ -2076,9 +2076,17 @@ UserSchema.statics.SetTelegramIdSuccess = async function(idapp, id, teleg_id) {
|
||||
idapp,
|
||||
_id: id,
|
||||
}, {$set: fields_to_update}, {new: false}).lean().then((record) => {
|
||||
return record;
|
||||
|
||||
if (record) {
|
||||
return User.findOne({
|
||||
idapp,
|
||||
_id: id
|
||||
}).lean();
|
||||
}
|
||||
});
|
||||
|
||||
return null;
|
||||
|
||||
};
|
||||
|
||||
UserSchema.statics.setUsernameTelegram = async function(
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
const tools = require('../tools/general');
|
||||
const Path = require('path');
|
||||
|
||||
const mongoose = require('mongoose').set('debug', false)
|
||||
|
||||
const shared_consts = require('../tools/shared_nodejs');
|
||||
|
||||
const globalTables = require('../tools/globalTables');
|
||||
@@ -124,10 +126,13 @@ module.exports = {
|
||||
}
|
||||
|
||||
if (mytab) {
|
||||
console.log('Delete ', table);
|
||||
await mytab.deleteMany({});
|
||||
await mytab.collection.drop();
|
||||
// mongoose.connection.db.dropCollection(table, function(err) {
|
||||
console.log('Delete ', table);
|
||||
// await mytab.remove({});
|
||||
|
||||
await this.insertIntoDb_NoDuplicate(false, table, mytab, field);
|
||||
this.insertIntoDb_NoDuplicate(false, table, mytab, field);
|
||||
// });
|
||||
}
|
||||
return true;
|
||||
} catch (e) {
|
||||
|
||||
@@ -1,117 +1,124 @@
|
||||
module.exports = {
|
||||
list: [
|
||||
{_id: 1, reg: 'SIC', prov: 'AG', descr: 'Agrigento'},
|
||||
{_id: 2, reg: 'PIE', prov: 'AL', descr: 'Alessandria'},
|
||||
{_id: 3, reg: 'MAR', prov: 'AN', descr: 'Ancona'},
|
||||
{_id: 4, reg: 'VDA', prov: 'AO', descr: 'Aosta'},
|
||||
{_id: 5, reg: 'TOS', prov: 'AR', descr: 'Arezzo'},
|
||||
{_id: 6, reg: 'MAR', prov: 'AP', descr: 'Ascoli Piceno'},
|
||||
{_id: 7, reg: 'PIE', prov: 'AT', descr: 'Asti'},
|
||||
{_id: 8, reg: 'CAM', prov: 'AV', descr: 'Avellino'},
|
||||
{_id: 9, reg: 'PUG', prov: 'BA', descr: 'Bari'},
|
||||
{_id: 10, reg: 'PUG', prov: 'BT', descr: 'Barletta-Andria-Trani'},
|
||||
{_id: 11, reg: 'VEN', prov: 'BL', descr: 'Belluno'},
|
||||
{_id: 12, reg: 'CAM', prov: 'BN', descr: 'Benevento'},
|
||||
{_id: 13, reg: 'LOM', prov: 'BG', descr: 'Bergamo'},
|
||||
{_id: 14, reg: 'PIE', prov: 'BI', descr: 'Biella'},
|
||||
{_id: 15, reg: 'EMR', prov: 'BO', descr: 'Bologna'},
|
||||
{_id: 16, reg: 'TAA', prov: 'BZ', descr: 'Bolzano'},
|
||||
{_id: 17, reg: 'LOM', prov: 'BS', descr: 'Brescia'},
|
||||
{_id: 18, reg: 'PUG', prov: 'BR', descr: 'Brindisi'},
|
||||
{_id: 19, reg: 'SAR', prov: 'CA', descr: 'Cagliari'},
|
||||
{_id: 20, reg: 'SIC', prov: 'CL', descr: 'Caltanissetta'},
|
||||
{_id: 21, reg: 'MOL', prov: 'CB', descr: 'Campobasso'},
|
||||
{_id: 22, reg: 'SAR', prov: 'CI', descr: 'Carbonia-Iglesias'},
|
||||
{_id: 23, reg: 'CAM', prov: 'CE', descr: 'Caserta'},
|
||||
{_id: 24, reg: 'SIC', prov: 'CT', descr: 'Catania'},
|
||||
{_id: 25, reg: 'CAL', prov: 'CZ', descr: 'Catanzaro'},
|
||||
{_id: 26, reg: 'ABR', prov: 'CH', descr: 'Chieti'},
|
||||
{_id: 27, reg: 'LOM', prov: 'CO', descr: 'Como'},
|
||||
{_id: 28, reg: 'CAL', prov: 'CS', descr: 'Cosenza'},
|
||||
{_id: 29, reg: 'LOM', prov: 'CR', descr: 'Cremona'},
|
||||
{_id: 30, reg: 'CAL', prov: 'KR', descr: 'Crotone'},
|
||||
{_id: 31, reg: 'PIE', prov: 'CN', descr: 'Cuneo'},
|
||||
{_id: 32, reg: 'SIC', prov: 'EN', descr: 'Enna'},
|
||||
{_id: 33, reg: 'MAR', prov: 'FM', descr: 'Fermo'},
|
||||
{_id: 34, reg: 'EMR', prov: 'FE', descr: 'Ferrara'},
|
||||
{_id: 35, reg: 'TOS', prov: 'FI', descr: 'Firenze'},
|
||||
{_id: 36, reg: 'PUG', prov: 'FG', descr: 'Foggia'},
|
||||
{_id: 37, reg: 'EMR', prov: 'FC', descr: 'Forli-Cesena'},
|
||||
{_id: 38, reg: 'LAZ', prov: 'FR', descr: 'Frosinone'},
|
||||
{_id: 39, reg: 'LIG', prov: 'GE', descr: 'Genova'},
|
||||
{_id: 40, reg: 'FVG', prov: 'GO', descr: 'Gorizia'},
|
||||
{_id: 41, reg: 'TOS', prov: 'GR', descr: 'Grosseto'},
|
||||
{_id: 42, reg: 'LIG', prov: 'IM', descr: 'Imperia'},
|
||||
{_id: 43, reg: 'MOL', prov: 'IS', descr: 'Isernia'},
|
||||
{_id: 44, reg: 'LIG', prov: 'SP', descr: 'La Spezia'},
|
||||
{_id: 45, reg: 'ABR', prov: 'AQ', descr: 'L\'Aquila'},
|
||||
{_id: 46, reg: 'LAZ', prov: 'LT', descr: 'Latina'},
|
||||
{_id: 47, reg: 'PUG', prov: 'LE', descr: 'Lecce'},
|
||||
{_id: 48, reg: 'LOM', prov: 'LC', descr: 'Lecco'},
|
||||
{_id: 49, reg: 'TOS', prov: 'LI', descr: 'Livorno'},
|
||||
{_id: 50, reg: 'LOM', prov: 'LO', descr: 'Lodi'},
|
||||
{_id: 51, reg: 'TOS', prov: 'LU', descr: 'Lucca'},
|
||||
{_id: 52, reg: 'MAR', prov: 'MC', descr: 'Macerata'},
|
||||
{_id: 53, reg: 'LOM', prov: 'MN', descr: 'Mantova'},
|
||||
{_id: 54, reg: 'TOS', prov: 'MS', descr: 'Massa-Carrara'},
|
||||
{_id: 55, reg: 'BAS', prov: 'MT', descr: 'Matera'},
|
||||
{_id: 56, reg: 'SIC', prov: 'ME', descr: 'Messina'},
|
||||
{_id: 57, reg: 'LOM', prov: 'MI', descr: 'Milano'},
|
||||
{_id: 58, reg: 'EMR', prov: 'MO', descr: 'Modena'},
|
||||
{_id: 59, reg: 'LOM', prov: 'MB', descr: 'Monza e della Brianza'},
|
||||
{_id: 60, reg: 'CAM', prov: 'NA', descr: 'Napoli'},
|
||||
{_id: 61, reg: 'PIE', prov: 'NO', descr: 'Novara'},
|
||||
{_id: 62, reg: 'SAR', prov: 'NU', descr: 'Nuoro'},
|
||||
{_id: 63, reg: 'SAR', prov: 'OT', descr: 'Olbia-Tempio'},
|
||||
{_id: 64, reg: 'SAR', prov: 'OR', descr: 'Oristano'},
|
||||
{_id: 65, reg: 'VEN', prov: 'PD', descr: 'Padova'},
|
||||
{_id: 66, reg: 'SIC', prov: 'PA', descr: 'Palermo'},
|
||||
{_id: 67, reg: 'EMR', prov: 'PR', descr: 'Parma'},
|
||||
{_id: 68, reg: 'LOM', prov: 'PV', descr: 'Pavia'},
|
||||
{_id: 69, reg: 'UMB', prov: 'PG', descr: 'Perugia'},
|
||||
{_id: 70, reg: 'MAR', prov: 'PU', descr: 'Pesaro e Urbino'},
|
||||
{_id: 71, reg: 'ABR', prov: 'PE', descr: 'Pescara'},
|
||||
{_id: 72, reg: 'EMR', prov: 'PC', descr: 'Piacenza'},
|
||||
{_id: 73, reg: 'TOS', prov: 'PI', descr: 'Pisa'},
|
||||
{_id: 74, reg: 'TOS', prov: 'PT', descr: 'Pistoia'},
|
||||
{_id: 75, reg: 'FVG', prov: 'PN', descr: 'Pordenone'},
|
||||
{_id: 76, reg: 'BAS', prov: 'PZ', descr: 'Potenza'},
|
||||
{_id: 77, reg: 'TOS', prov: 'PO', descr: 'Prato'},
|
||||
{_id: 78, reg: 'SIC', prov: 'RG', descr: 'Ragusa'},
|
||||
{_id: 79, reg: 'EMR', prov: 'RA', descr: 'Ravenna'},
|
||||
{_id: 80, reg: 'CAL', prov: 'RC', descr: 'Reggio CAL'},
|
||||
{_id: 81, reg: 'EMR', prov: 'RE', descr: 'Reggio Emilia'},
|
||||
{_id: 82, reg: 'LAZ', prov: 'RI', descr: 'Rieti'},
|
||||
{_id: 83, reg: 'EMR', prov: 'RN', descr: 'Rimini'},
|
||||
{_id: 84, reg: 'LAZ', prov: 'RM', descr: 'Roma'},
|
||||
{_id: 85, reg: 'VEN', prov: 'RO', descr: 'Rovigo'},
|
||||
{_id: 86, reg: 'CAM', prov: 'SA', descr: 'Salerno'},
|
||||
{_id: 87, reg: 'SAR', prov: 'VS', descr: 'Medio Campidano'},
|
||||
{_id: 88, reg: 'SAR', prov: 'SS', descr: 'Sassari'},
|
||||
{_id: 89, reg: 'LIG', prov: 'SV', descr: 'Savona'},
|
||||
{_id: 90, reg: 'TOS', prov: 'SI', descr: 'Siena'},
|
||||
{_id: 91, reg: 'SIC', prov: 'SR', descr: 'Siracusa'},
|
||||
{_id: 92, reg: 'LOM', prov: 'SO', descr: 'Sondrio'},
|
||||
{_id: 93, reg: 'PUG', prov: 'TA', descr: 'Taranto'},
|
||||
{_id: 94, reg: 'ABR', prov: 'TE', descr: 'Teramo'},
|
||||
{_id: 95, reg: 'UMB', prov: 'TR', descr: 'Terni'},
|
||||
{_id: 96, reg: 'PIE', prov: 'TO', descr: 'Torino'},
|
||||
{_id: 97, reg: 'SAR', prov: 'OG', descr: 'Ogliastra'},
|
||||
{_id: 98, reg: 'SIC', prov: 'TP', descr: 'Trapani'},
|
||||
{_id: 99, reg: 'TAA', prov: 'TN', descr: 'Trento'},
|
||||
{_id: 100, reg: 'VEN', prov: 'TV', descr: 'Treviso'},
|
||||
{_id: 101, reg: 'FVG', prov: 'TS', descr: 'Trieste'},
|
||||
{_id: 102, reg: 'FVG', prov: 'UD', descr: 'Udine'},
|
||||
{_id: 103, reg: 'LOM', prov: 'VA', descr: 'Varese'},
|
||||
{_id: 104, reg: 'VEN', prov: 'VE', descr: 'Venezia'},
|
||||
{_id: 105, reg: 'PIE', prov: 'VB', descr: 'Verbano-Cusio-Ossola'},
|
||||
{_id: 106, reg: 'PIE', prov: 'VC', descr: 'Vercelli'},
|
||||
{_id: 107, reg: 'VEN', prov: 'VR', descr: 'Verona'},
|
||||
{_id: 108, reg: 'CAL', prov: 'VV', descr: 'Vibo Valentia'},
|
||||
{_id: 109, reg: 'VEN', prov: 'VI', descr: 'Vicenza'},
|
||||
{_id: 110, reg: 'LAZ', prov: 'VT', descr: 'Viterbo'},
|
||||
{_id: 111, reg: 'RSM', prov: 'RSM', descr: 'Repubblica di San Marino'},
|
||||
{_id: 112, reg: 'EST', prov: 'EST', descr: 'Estero'},
|
||||
{_id: 113, reg: 'ONL', prov: 'ONL', descr: 'On Line'},
|
||||
{_id: 1, reg: 'SIC', prov: 'AG', descr: 'Agrigento', link_grp: 'https://t.me/c/1614195634/562?thread=553'},
|
||||
{_id: 2, reg: 'PIE', prov: 'AL', descr: 'Alessandria', link_grp: 'https://t.me/c/1614195634/513?thread=504'},
|
||||
{_id: 3, reg: 'MAR', prov: 'AN', descr: 'Ancona', link_grp: 'https://t.me/c/1614195634/450?thread=446'},
|
||||
{_id: 4, reg: 'VDA', prov: 'AO', descr: 'Aosta', link_grp: 'https://t.me/c/1614195634/521?thread=520'},
|
||||
{_id: 5, reg: 'TOS', prov: 'AR', descr: 'Arezzo', link_grp: 'https://t.me/c/1614195634/583?thread=572'},
|
||||
{_id: 6, reg: 'MAR', prov: 'AP', descr: 'Ascoli Piceno', link_grp: 'https://t.me/c/1614195634/451?thread=447'},
|
||||
{_id: 7, reg: 'PIE', prov: 'AT', descr: 'Asti', link_grp: 'https://t.me/c/1614195634/514?thread=505'},
|
||||
{_id: 8, reg: 'CAM', prov: 'AV', descr: 'Avellino', link_grp: 'https://t.me/c/1614195634/413?thread=409'},
|
||||
{_id: 9, reg: 'PUG', prov: 'BA', descr: 'Bari', link_grp: 'https://t.me/c/1614195634/534?thread=528'},
|
||||
{_id: 10, reg: 'PUG', prov: 'BT', descr: 'Barletta-Andria-Trani', link_grp: 'https://t.me/c/1614195634/535?thread=529'},
|
||||
{_id: 11, reg: 'VEN', prov: 'BL', descr: 'Belluno', link_grp: 'https://t.me/c/1614195634/608?thread=599'},
|
||||
{_id: 12, reg: 'CAM', prov: 'BN', descr: 'Benevento', link_grp: 'https://t.me/c/1614195634/415?thread=411'},
|
||||
{_id: 13, reg: 'LOM', prov: 'BG', descr: 'Bergamo', link_grp: 'https://t.me/c/1614195634/491?thread=477'},
|
||||
{_id: 14, reg: 'PIE', prov: 'BI', descr: 'Biella', link_grp: 'https://t.me/c/1614195634/515?thread=506'},
|
||||
{_id: 15, reg: 'EMR', prov: 'BO', descr: 'Bologna', link_grp: 'https://t.me/c/1614195634/428?thread=419'},
|
||||
{_id: 16, reg: 'TAA', prov: 'BZ', descr: 'Bolzano', link_grp: 'https://t.me/c/1614195634/596?thread=594'},
|
||||
{_id: 17, reg: 'LOM', prov: 'BS', descr: 'Brescia', link_grp: 'https://t.me/c/1614195634/490?thread=478'},
|
||||
{_id: 18, reg: 'PUG', prov: 'BR', descr: 'Brindisi', link_grp: 'https://t.me/c/1614195634/536?thread=530'},
|
||||
{_id: 19, reg: 'SAR', prov: 'CA', descr: 'Cagliari', link_grp: 'https://t.me/c/1614195634/546?thread=541'},
|
||||
{_id: 20, reg: 'SIC', prov: 'CL', descr: 'Caltanissetta', link_grp: 'https://t.me/c/1614195634/563?thread=554'},
|
||||
{_id: 21, reg: 'MOL', prov: 'CB', descr: 'Campobasso', link_grp: 'https://t.me/c/1614195634/398?thread=396'},
|
||||
{_id: 22, reg: 'SAR', prov: 'CI', descr: 'Carbonia-Iglesias', link_grp: ''},
|
||||
{_id: 23, reg: 'CAM', prov: 'CE', descr: 'Caserta', link_grp: 'https://t.me/c/1614195634/414?thread=410'},
|
||||
{_id: 24, reg: 'SIC', prov: 'CT', descr: 'Catania', link_grp: 'https://t.me/c/1614195634/564?thread=555'},
|
||||
{_id: 25, reg: 'CAL', prov: 'CZ', descr: 'Catanzaro', link_grp: 'https://t.me/c/1614195634/378?thread=377'},
|
||||
{_id: 26, reg: 'ABR', prov: 'CH', descr: 'Chieti', link_grp: 'https://t.me/c/1614195634/366?thread=365'},
|
||||
{_id: 27, reg: 'LOM', prov: 'CO', descr: 'Como', link_grp: 'https://t.me/c/1614195634/492?thread=479'},
|
||||
{_id: 28, reg: 'CAL', prov: 'CS', descr: 'Cosenza', link_grp: 'https://t.me/c/1614195634/381?thread=379'},
|
||||
{_id: 29, reg: 'LOM', prov: 'CR', descr: 'Cremona', link_grp: 'https://t.me/c/1614195634/493?thread=480'},
|
||||
{_id: 30, reg: 'CAL', prov: 'KR', descr: 'Crotone', link_grp: 'https://t.me/c/1614195634/382?thread=380'},
|
||||
{_id: 31, reg: 'PIE', prov: 'CN', descr: 'Cuneo', link_grp: 'https://t.me/c/1614195634/516?thread=507'},
|
||||
{_id: 32, reg: 'SIC', prov: 'EN', descr: 'Enna', link_grp: 'https://t.me/c/1614195634/565?thread=556'},
|
||||
{_id: 33, reg: 'MAR', prov: 'FM', descr: 'Fermo', link_grp: 'https://t.me/c/1614195634/453?thread=448'},
|
||||
{_id: 34, reg: 'EMR', prov: 'FE', descr: 'Ferrara', link_grp: 'https://t.me/c/1614195634/429?thread=420'},
|
||||
{_id: 35, reg: 'TOS', prov: 'FI', descr: 'Firenze', link_grp: 'https://t.me/c/1614195634/584?thread=573'},
|
||||
{_id: 36, reg: 'PUG', prov: 'FG', descr: 'Foggia', link_grp: 'https://t.me/c/1614195634/537?thread=531'},
|
||||
{_id: 37, reg: 'EMR', prov: 'FC', descr: 'Forli-Cesena', link_grp: 'https://t.me/c/1614195634/430?thread=421'},
|
||||
{_id: 38, reg: 'LAZ', prov: 'FR', descr: 'Frosinone', link_grp: 'https://t.me/c/1614195634/48?thread=44'},
|
||||
{_id: 39, reg: 'LIG', prov: 'GE', descr: 'Genova', link_grp: 'https://t.me/c/1614195634/392?thread=388'},
|
||||
{_id: 40, reg: 'FVG', prov: 'GO', descr: 'Gorizia', link_grp: 'https://t.me/c/1614195634/469?thread=465'},
|
||||
{_id: 41, reg: 'TOS', prov: 'GR', descr: 'Grosseto', link_grp: 'https://t.me/c/1614195634/585?thread=574'},
|
||||
{_id: 42, reg: 'LIG', prov: 'IM', descr: 'Imperia', link_grp: 'https://t.me/c/1614195634/393?thread=389'},
|
||||
{_id: 43, reg: 'MOL', prov: 'IS', descr: 'Isernia', link_grp: 'https://t.me/c/1614195634/399?thread=397'},
|
||||
{_id: 44, reg: 'LIG', prov: 'SP', descr: 'La Spezia', link_grp: 'https://t.me/c/1614195634/394?thread=390'},
|
||||
{_id: 45, reg: 'ABR', prov: 'AQ', descr: 'L\'Aquila', link_grp: 'https://t.me/c/1614195634/364?thread=363'},
|
||||
{_id: 46, reg: 'LAZ', prov: 'LT', descr: 'Latina', link_grp: 'https://t.me/c/1614195634/60?thread=46'},
|
||||
{_id: 47, reg: 'PUG', prov: 'LE', descr: 'Lecce', link_grp: 'https://t.me/c/1614195634/538?thread=532'},
|
||||
{_id: 48, reg: 'LOM', prov: 'LC', descr: 'Lecco', link_grp: 'https://t.me/c/1614195634/494?thread=482'},
|
||||
{_id: 49, reg: 'TOS', prov: 'LI', descr: 'Livorno', link_grp: 'https://t.me/c/1614195634/586?thread=575'},
|
||||
{_id: 50, reg: 'LOM', prov: 'LO', descr: 'Lodi', link_grp: 'https://t.me/c/1614195634/495?thread=483'},
|
||||
{_id: 51, reg: 'TOS', prov: 'LU', descr: 'Lucca', link_grp: 'https://t.me/c/1614195634/587?thread=576'},
|
||||
{_id: 52, reg: 'MAR', prov: 'MC', descr: 'Macerata', link_grp: 'https://t.me/c/1614195634/300?thread=162'},
|
||||
{_id: 53, reg: 'LOM', prov: 'MN', descr: 'Mantova', link_grp: 'https://t.me/c/1614195634/497?thread=484'},
|
||||
{_id: 54, reg: 'TOS', prov: 'MS', descr: 'Massa-Carrara', link_grp: 'https://t.me/c/1614195634/588?thread=577'},
|
||||
{_id: 55, reg: 'BAS', prov: 'MT', descr: 'Matera', link_grp: 'https://t.me/c/1614195634/374?thread=373'},
|
||||
{_id: 56, reg: 'SIC', prov: 'ME', descr: 'Messina', link_grp: 'https://t.me/c/1614195634/566?thread=557'},
|
||||
{_id: 57, reg: 'LOM', prov: 'MI', descr: 'Milano', link_grp: 'https://t.me/c/1614195634/214?thread=173'},
|
||||
{_id: 58, reg: 'EMR', prov: 'MO', descr: 'Modena', link_grp: 'https://t.me/c/1614195634/431?thread=422'},
|
||||
{_id: 59, reg: 'LOM', prov: 'MB', descr: 'Monza e della Brianza', link_grp: 'https://t.me/c/1614195634/498?thread=485'},
|
||||
{_id: 60, reg: 'CAM', prov: 'NA', descr: 'Napoli', link_grp: 'https://t.me/c/1614195634/407?thread=406'},
|
||||
{_id: 61, reg: 'PIE', prov: 'NO', descr: 'Novara', link_grp: 'https://t.me/c/1614195634/517?thread=508'},
|
||||
{_id: 62, reg: 'SAR', prov: 'NU', descr: 'Nuoro', link_grp: 'https://t.me/c/1614195634/548?thread=542'},
|
||||
{_id: 63, reg: 'SAR', prov: 'OT', descr: 'Olbia-Tempio', link_grp: ''},
|
||||
{_id: 64, reg: 'SAR', prov: 'OR', descr: 'Oristano', link_grp: 'https://t.me/c/1614195634/550?thread=543'},
|
||||
{_id: 65, reg: 'VEN', prov: 'PD', descr: 'Padova', link_grp: 'https://t.me/c/1614195634/610?thread=600'},
|
||||
{_id: 66, reg: 'SIC', prov: 'PA', descr: 'Palermo', link_grp: 'https://t.me/c/1614195634/568?thread=558'},
|
||||
{_id: 67, reg: 'EMR', prov: 'PR', descr: 'Parma', link_grp: 'https://t.me/c/1614195634/432?thread=423'},
|
||||
{_id: 68, reg: 'LOM', prov: 'PV', descr: 'Pavia', link_grp: 'https://t.me/c/1614195634/499?thread=486'},
|
||||
{_id: 69, reg: 'UMB', prov: 'PG', descr: 'Perugia', link_grp: 'https://t.me/c/1614195634/403?thread=401'},
|
||||
{_id: 70, reg: 'MAR', prov: 'PU', descr: 'Pesaro e Urbino', link_grp: 'https://t.me/c/1614195634/454?thread=449'},
|
||||
{_id: 71, reg: 'ABR', prov: 'PE', descr: 'Pescara', link_grp: 'https://t.me/c/1614195634/368?thread=367'},
|
||||
{_id: 72, reg: 'EMR', prov: 'PC', descr: 'Piacenza', link_grp: 'https://t.me/c/1614195634/433?thread=424'},
|
||||
{_id: 73, reg: 'TOS', prov: 'PI', descr: 'Pisa', link_grp: 'https://t.me/c/1614195634/589?thread=578'},
|
||||
{_id: 74, reg: 'TOS', prov: 'PT', descr: 'Pistoia', link_grp: 'https://t.me/c/1614195634/590?thread=579'},
|
||||
{_id: 75, reg: 'FVG', prov: 'PN', descr: 'Pordenone', link_grp: 'https://t.me/c/1614195634/470?thread=466'},
|
||||
{_id: 76, reg: 'BAS', prov: 'PZ', descr: 'Potenza', link_grp: 'https://t.me/c/1614195634/376?thread=375'},
|
||||
{_id: 77, reg: 'TOS', prov: 'PO', descr: 'Prato', link_grp: 'https://t.me/c/1614195634/591?thread=580'},
|
||||
{_id: 78, reg: 'SIC', prov: 'RG', descr: 'Ragusa', link_grp: 'https://t.me/c/1614195634/569?thread=559'},
|
||||
{_id: 79, reg: 'EMR', prov: 'RA', descr: 'Ravenna', link_grp: 'https://t.me/c/1614195634/434?thread=425'},
|
||||
{_id: 80, reg: 'CAL', prov: 'RC', descr: 'Reggio Calabria', link_grp: 'https://t.me/c/1614195634/385?thread=383'},
|
||||
{_id: 81, reg: 'EMR', prov: 'RE', descr: 'Reggio Emilia', link_grp: 'https://t.me/c/1614195634/435?thread=426'},
|
||||
{_id: 82, reg: 'LAZ', prov: 'RI', descr: 'Rieti', link_grp: 'https://t.me/c/1614195634/61?thread=45'},
|
||||
{_id: 83, reg: 'EMR', prov: 'RN', descr: 'Rimini', link_grp: 'https://t.me/c/1614195634/436?thread=https://t.me/c/1614195634/64?thread=57427'},
|
||||
{_id: 84, reg: 'LAZ', prov: 'RM', descr: 'Roma', link_grp: ''},
|
||||
{_id: 85, reg: 'VEN', prov: 'RO', descr: 'Rovigo', link_grp: 'https://t.me/c/1614195634/611?thread=601'},
|
||||
{_id: 86, reg: 'CAM', prov: 'SA', descr: 'Salerno', link_grp: 'https://t.me/c/1614195634/416?thread=412'},
|
||||
{_id: 87, reg: 'SAR', prov: 'VS', descr: 'Medio Campidano', link_grp: ''},
|
||||
{_id: 88, reg: 'SAR', prov: 'SS', descr: 'Sassari', link_grp: 'https://t.me/c/1614195634/551?thread=544'},
|
||||
{_id: 89, reg: 'LIG', prov: 'SV', descr: 'Savona', link_grp: 'https://t.me/c/1614195634/395?thread=391'},
|
||||
{_id: 90, reg: 'TOS', prov: 'SI', descr: 'Siena', link_grp: 'https://t.me/c/1614195634/592?thread=581'},
|
||||
{_id: 91, reg: 'SIC', prov: 'SR', descr: 'Siracusa', link_grp: 'https://t.me/c/1614195634/570?thread=560'},
|
||||
{_id: 92, reg: 'LOM', prov: 'SO', descr: 'Sondrio', link_grp: 'https://t.me/c/1614195634/500?thread=487'},
|
||||
{_id: 93, reg: 'PUG', prov: 'TA', descr: 'Taranto', link_grp: 'https://t.me/c/1614195634/539?thread=533'},
|
||||
{_id: 94, reg: 'ABR', prov: 'TE', descr: 'Teramo', link_grp: 'https://t.me/c/1614195634/370?thread=369'},
|
||||
{_id: 95, reg: 'UMB', prov: 'TR', descr: 'Terni', link_grp: 'https://t.me/c/1614195634/404?thread=402'},
|
||||
{_id: 96, reg: 'PIE', prov: 'TO', descr: 'Torino', link_grp: 'https://t.me/c/1614195634/518?thread=509'},
|
||||
{_id: 97, reg: 'SAR', prov: 'OG', descr: 'Ogliastra', link_grp: ''},
|
||||
{_id: 98, reg: 'SIC', prov: 'TP', descr: 'Trapani', link_grp: 'https://t.me/c/1614195634/571?thread=561'},
|
||||
{_id: 99, reg: 'TAA', prov: 'TN', descr: 'Trento', link_grp: 'https://t.me/c/1614195634/597?thread=595'},
|
||||
{_id: 100, reg: 'VEN', prov: 'TV', descr: 'Treviso', link_grp: 'https://t.me/c/1614195634/612?thread=602'},
|
||||
{_id: 101, reg: 'FVG', prov: 'TS', descr: 'Trieste', link_grp: 'https://t.me/c/1614195634/471?thread=467'},
|
||||
{_id: 102, reg: 'FVG', prov: 'UD', descr: 'Udine', link_grp: 'https://t.me/c/1614195634/472?thread=468'},
|
||||
{_id: 103, reg: 'LOM', prov: 'VA', descr: 'Varese', link_grp: 'https://t.me/c/1614195634/501?thread=488'},
|
||||
{_id: 104, reg: 'VEN', prov: 'VE', descr: 'Venezia', link_grp: 'https://t.me/c/1614195634/613?thread=603'},
|
||||
{_id: 105, reg: 'PIE', prov: 'VB', descr: 'Verbano-Cusio-Ossola', link_grp: 'https://t.me/c/1614195634/519?thread=510 '},
|
||||
{_id: 106, reg: 'PIE', prov: 'VC', descr: 'Vercelli', link_grp: 'https://t.me/c/1614195634/512?thread=511'},
|
||||
{_id: 107, reg: 'VEN', prov: 'VR', descr: 'Verona', link_grp: 'https://t.me/c/1614195634/614?thread=604'},
|
||||
{_id: 108, reg: 'CAL', prov: 'VV', descr: 'Vibo Valentia', link_grp: 'https://t.me/c/1614195634/386?thread=384'},
|
||||
{_id: 109, reg: 'VEN', prov: 'VI', descr: 'Vicenza', link_grp: 'https://t.me/c/1614195634/615?thread=605'},
|
||||
{_id: 110, reg: 'LAZ', prov: 'VT', descr: 'Viterbo', link_grp: 'https://t.me/c/1614195634/76?thread=74'},
|
||||
{_id: 111, reg: 'RSM', prov: 'RSM', descr: 'Repubblica di San Marino', link_grp: ''},
|
||||
{_id: 112, reg: 'EST', prov: 'EST', descr: 'Estero', link_grp: ''},
|
||||
{_id: 113, reg: 'ONL', prov: 'ONL', descr: 'On Line', link_grp: ''},
|
||||
{_id: 114, reg: 'LAZ', prov: 'RM', descr: 'Roma Nord-Est', link_grp: 'https://t.me/c/1614195634/64?thread=57'},
|
||||
{_id: 115, reg: 'LAZ', prov: 'RM', descr: 'Roma Sud-Est', link_grp: 'https://t.me/c/1614195634/65?thread=58'},
|
||||
{_id: 116, reg: 'LAZ', prov: 'RM', descr: 'Roma Nord', link_grp: 'https://t.me/c/1614195634/75?thread=73'},
|
||||
{_id: 117, reg: 'LAZ', prov: 'RM', descr: 'Roma Nord-Ovest', link_grp: 'https://t.me/c/1614195634/62?thread=47'},
|
||||
{_id: 118, reg: 'LAZ', prov: 'RM', descr: 'Roma Sud e Litorale', link_grp: 'https://t.me/c/1614195634/67?thread=43'},
|
||||
{_id: 119, reg: 'PUG', prov: 'VAL', descr: 'Valle D\'Itria', link_grp: 'https://t.me/progettoriso/7016?thread=7015'},
|
||||
{_id: 120, reg: 'SAR', prov: 'SUS', descr: 'Sud Sardegna', link_grp: 'https://t.me/c/1614195634/552?thread=545'},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -12,6 +12,7 @@ module.exports = {
|
||||
{_id: 10, descr: 'Per la Persona'},
|
||||
{_id: 11, descr: 'Progetti di Gruppo'},
|
||||
{_id: 12, descr: 'Salute'},
|
||||
{_id: 13, descr: 'Tecnologia'},
|
||||
{_id: 13, descr: 'Tecnologie'},
|
||||
{_id: 14, descr: 'Servizi'},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -95,7 +95,6 @@ module.exports = {
|
||||
{_id: 93, idSector: [12], descr: 'Psicoterapeuta'},
|
||||
{_id: 94, idSector: [12], descr: 'Ostetrica'},
|
||||
{_id: 95, idSector: [12], descr: 'Nutrizionista'},
|
||||
{_id: 96, idSector: [12], descr: 'Naturopata'},
|
||||
{_id: 97, idSector: [12], descr: 'Counseling'},
|
||||
{_id: 98, idSector: [13], descr: 'Assistenza PC / software'},
|
||||
{_id: 99, idSector: [13], descr: 'Assistenza Cellulari'},
|
||||
@@ -114,5 +113,13 @@ module.exports = {
|
||||
{_id: 112, idSector: [6], descr: 'Costellazioni Familiari'},
|
||||
{_id: 113, idSector: [6], descr: 'Coach Motivazionale'},
|
||||
{_id: 114, idSector: [6], descr: 'Tecniche Essene'},
|
||||
{_id: 115, idSector: [6], descr: 'Riflessologia'},
|
||||
{_id: 116, idSector: [6], descr: 'Naturopatia'},
|
||||
{_id: 117, idSector: [14], descr: 'Organizzazione Aziendale'},
|
||||
{_id: 118, idSector: [14], descr: 'Project Manager'},
|
||||
{_id: 119, idSector: [14], descr: 'Consulenze per Startup'},
|
||||
{_id: 120, idSector: [14], descr: 'Grafica'},
|
||||
{_id: 121, idSector: [14], descr: 'Web'},
|
||||
{_id: 122, idSector: [14], descr: 'Progettazione'},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -3,14 +3,8 @@ const router = express.Router(),
|
||||
fs = require('fs'),
|
||||
path = require('path');
|
||||
|
||||
const jwt = require('jsonwebtoken');
|
||||
|
||||
const telegrambot = require('../telegram/telegrambot');
|
||||
|
||||
const sendemail = require('../sendemail');
|
||||
|
||||
const resizer = require('node-image-resizer');
|
||||
|
||||
const sharp = require('sharp');
|
||||
|
||||
const {authenticate, authenticate_noerror} = require(
|
||||
@@ -23,11 +17,11 @@ const {Graduatoria} = require('../models/graduatoria');
|
||||
const mongoose = require('mongoose').set('debug', false);
|
||||
const cfgserver = mongoose.model('cfgserver');
|
||||
|
||||
const uuidv4 = require('uuid/v4'); // I chose v4 ‒ you can select others
|
||||
// const uuidv4 = require('uuid/v4'); // I chose v4 ‒ you can select others
|
||||
|
||||
const ftp = require('../ftp/FTPClient'),
|
||||
formidable = require('formidable'),
|
||||
folder = path.join(__dirname, 'upload');
|
||||
// const ftp = require('../ftp/FTPClient');
|
||||
const formidable = require('formidable');
|
||||
const folder = path.join(__dirname, 'upload');
|
||||
|
||||
if (!fs.existsSync(folder)) {
|
||||
fs.mkdirSync(folder);
|
||||
@@ -37,7 +31,6 @@ const _ = require('lodash');
|
||||
|
||||
const {User} = require('../models/user');
|
||||
const {MyGroup} = require('../models/mygroup');
|
||||
// const { ExtraList } = require('../models/extralist');
|
||||
const {Booking} = require('../models/booking');
|
||||
const {Operator} = require('../models/operator');
|
||||
const {Where} = require('../models/where');
|
||||
@@ -47,11 +40,7 @@ const {PaymentType} = require('../models/paymenttype');
|
||||
const {Discipline} = require('../models/discipline');
|
||||
const {Skill} = require('../models/skill');
|
||||
const {Good} = require('../models/good');
|
||||
const {SubSkill} = require('../models/subskill');
|
||||
const {MySkill} = require('../models/myskill');
|
||||
const {MyGood} = require('../models/mygood');
|
||||
const {StatusSkill} = require('../models/statusSkill');
|
||||
const {City} = require('../models/city');
|
||||
const {Province} = require('../models/province');
|
||||
const {Sector} = require('../models/sector');
|
||||
const {SectorGood} = require('../models/sectorgood');
|
||||
@@ -59,15 +48,10 @@ const {CatGrp} = require('../models/catgrp');
|
||||
const {Level} = require('../models/level');
|
||||
const {AdType} = require('../models/adtype');
|
||||
const {AdTypeGood} = require('../models/adtypegood');
|
||||
const Pickup = require('../models/pickup');
|
||||
const {Newstosent} = require('../models/newstosent');
|
||||
const {MyPage} = require('../models/mypage');
|
||||
const {MyBot} = require('../models/bot');
|
||||
const {CalZoom} = require('../models/calzoom');
|
||||
const {Gallery} = require('../models/gallery');
|
||||
const {TemplEmail} = require('../models/templemail');
|
||||
const {OpzEmail} = require('../models/opzemail');
|
||||
const {MailingList} = require('../models/mailinglist');
|
||||
const {Settings} = require('../models/settings');
|
||||
const {SendMsg} = require('../models/sendmsg');
|
||||
const {Permission} = require('../models/permission');
|
||||
@@ -110,7 +94,6 @@ router.post(process.env.LINKVERIF_REG, (req, res) => {
|
||||
const body = _.pick(req.body, ['idapp', 'idlink']);
|
||||
const idapp = body.idapp;
|
||||
const idlink = body.idlink;
|
||||
// console.log("LINKVERIF_REG POST " + process.env.LINKVERIF_REG + " idapp= " + idapp + " idlink = " + idlink);
|
||||
|
||||
// Cerco l'idlink se è ancora da Verificare
|
||||
|
||||
@@ -1087,7 +1070,8 @@ function load(req, res, version) {
|
||||
let sectors = Sector.findAllIdApp(idapp);
|
||||
let sectorgoods = SectorGood.findAllIdApp(idapp);
|
||||
let catgrps = CatGrp.findAllIdApp(idapp);
|
||||
let cities = City.findAllIdApp(idapp);
|
||||
// let cities = City.findAllIdApp(idapp);
|
||||
let provinces = Province.findAllIdApp(idapp);
|
||||
let cart = null;
|
||||
let orderscart = null;
|
||||
if (gestoredelSito) {
|
||||
@@ -1143,7 +1127,9 @@ function load(req, res, version) {
|
||||
myuserextra,
|
||||
sectors,
|
||||
statusSkills,
|
||||
cities,
|
||||
provinces,
|
||||
// cities,
|
||||
provinces,
|
||||
catgrps,
|
||||
adtypes,
|
||||
adtypegoods,
|
||||
@@ -1220,7 +1206,7 @@ function load(req, res, version) {
|
||||
// myuser arrdata[26]
|
||||
sectors: arrdata[27],
|
||||
statusSkills: arrdata[28],
|
||||
cities: arrdata[29],
|
||||
provinces: arrdata[29],
|
||||
catgrps: arrdata[30],
|
||||
adtypes: arrdata[31],
|
||||
adtypegoods: arrdata[32],
|
||||
|
||||
@@ -125,20 +125,30 @@ router.post('/send', authenticate, async (req, res) => {
|
||||
send({code: server_constants.RIS_CODE_ERR_UNAUTHORIZED, msg: ''});
|
||||
}
|
||||
|
||||
let msgcosa = 'da Inviare';
|
||||
if (params.sendreally) {
|
||||
msgcosa = 'Inviati';
|
||||
}
|
||||
|
||||
try {
|
||||
if (params.typesend === 0)
|
||||
params.typesend = shared_consts.TypeSend.PUSH_NOTIFICATION;
|
||||
params.sendreally = true;
|
||||
|
||||
if (params.typemsg === shared_consts.TypeMsg.SEND_TO_MYSELF) {
|
||||
params.usernameDest = req.user.username;
|
||||
}
|
||||
|
||||
const ris = await globalTables.SendMsgToParam(idapp, params);
|
||||
|
||||
|
||||
return res.send({
|
||||
code: server_constants.RIS_CODE_OK,
|
||||
msg: ris.nummsgsent + ' Msg Inviati su ' + ris.numrec + ' !',
|
||||
msg: ris.nummsgsent + ` Msg ${msgcosa} su ` + ris.numrec + ' !',
|
||||
nummsg: ris.nummsgsent,
|
||||
});
|
||||
} catch (e) {
|
||||
return res.send(
|
||||
{code: server_constants.RIS_CODE_ERR, msg: nummsg + ' Msg Inviati !'});
|
||||
{code: server_constants.RIS_CODE_ERR, msg: nummsg + ` Msg ${msgcosa} !`});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -16,6 +16,8 @@ const {CalZoom} = require('../models/calzoom');
|
||||
const {MyBot} = require('../models/bot');
|
||||
const shared_consts = require('../tools/shared_nodejs');
|
||||
|
||||
const sharp = require('sharp');
|
||||
|
||||
const server_constants = require('../tools/server_constants');
|
||||
|
||||
// const {ListaIngresso} = require('../models/listaingresso');
|
||||
@@ -464,39 +466,15 @@ const StatusMSGALL = {
|
||||
const txt = {
|
||||
MSG_SCEGLI_MENU: emoji.get('dizzy') + ' Scegli una voce di menu:' +
|
||||
emoji.get('dizzy'),
|
||||
MSG_ASK_USERNAME_BO: 'Scrivi nel messaggio lo username o la email con cui ti sei registrato sul sito di %s:',
|
||||
MSG_ASK_USERNAME_BO: 'Scrivete nel messaggio l\'username (SENZA SPAZI) o la email con cui vi siete registrati sul sito di %s:',
|
||||
MSG_ERRORE_USERNAME: 'Attenzione! Devi inserire solo lo username (40 caratteri massimo)',
|
||||
MSG_ERRORE_USERNAME_NOT_FOUND: 'Per Completare la Verifica Telegram BOT, devi ora scrivere qui sotto nel messaggio l\'Username OPPURE la email con cui ti sei registrato sul sito',
|
||||
MSG_ERRORE_USERNAME_NOT_FOUND: 'Per Completare la Verifica Telegram BOT, dovete ora scrivere qui sotto nel messaggio l\'Username (senza spazi) OPPURE la email con cui vi siete registrati sul sito',
|
||||
MSG_ERRORE_USERNAME_ANNULLA: 'Inserimento Annullato. Riprovare',
|
||||
MSG_OPERAZ_ANNULLATA: 'Operazione Annullata',
|
||||
MSG_ERRORE_VERIFY_CODE_MAXLEN: 'Attenzione! Devi inserire solo il codice a 6 cifre',
|
||||
MSG_VERIFY_CODE: '1. Ora ritorna sul sito:\n%s\n2. Copia il codice di Autenticazione (di 6 cifre) che troverai scritto in alto\n3. Scrivilo (o incollalo) qui sotto come messaggio:',
|
||||
MSG_ERR_VERIFY_CODE: 'Codice di Verifica Errato!' + emo.EXCLAMATION_MARK +
|
||||
'\nControlla sul sito %s e riscrivi il nuovo codice di 6 cifre.',
|
||||
MSG_VERIFY_OK: emoji.get('grinning') +
|
||||
' ✅🌈 Benvenuto %s!\n' +
|
||||
'Ti sei correttamente verificato con il BOT. ' +
|
||||
'\nSono il tuo assistente virtuale (BOT).\n\n' +
|
||||
'Questa chat ti servirà per interagire con la Piattaforma e per ricevere delle notifiche Personali.\n' +
|
||||
'' +
|
||||
'(🆘 Per Aiuti, guarda il menu qui sotto)\n\n' +
|
||||
'' +
|
||||
'😍😍😍 Ora sei pronto per Entrare nella APP!\n' +
|
||||
'👉🏻 Clicca qui: %s',
|
||||
MSG_SET_USERNAME: '✨✨✨✨✨✨✨✨✨✨\n' +
|
||||
'🔑 Devi impostare un Username per Telegram:\n' +
|
||||
'\n' +
|
||||
'👉🏻 1. Premi sull\'icona (tre linee orizzontali) del <b>menu principale</b> in alto a sinistra.\n' +
|
||||
'👉🏻 2. Seleziona la voce <b>Impostazioni</b> nel menu.\n' +
|
||||
'👉🏻 3.Premi su <b>Username</b> nella sezione account.\n' +
|
||||
'👉🏻 4. Digita il tuo username. Deve essere un nome ancora libero e non già usato da altri.\n' +
|
||||
'👉🏻 5. Per confermare premi sull\'icona con la spunta in alto a destra.\n' +
|
||||
'🏁 Infine scrivi OK su questa chat. \n' +
|
||||
'(Se non riesci clicca qui per la guida: www.nigiara.it/telegram/come-impostare-uno-username-su-telegram.htm) \n\n' +
|
||||
'💬 In questo modo le persone potranno contattarti dalla APP cliccando sull\'icona di Telegram, presente nel tuo profilo.',
|
||||
MSG_SET_USERNAME_OK: '😄😄✅✅ Ottimo! Hai impostato lo Username Telegram!\n\n' +
|
||||
'Ora le persone potranno contattarti su Telegram, anche dalla APP visitando il tuo profilo e cliccando sull\'icona di Telegram, (senza dover pubblicare il proprio numero di cellulare).\n\n' +
|
||||
'Ora puoi proseguire sulla APP.',
|
||||
MSG_SET_PICPROFILE: '🖼 Abbiamo impostato <b>la tua foto del Profilo</b>, copiandola dalla foto profilo di Telegram. Potrai comunque cambiarla dalla APP (%s)',
|
||||
MSG_RESETPWD: 'Clicca qui per impostare una nuova password per accedere alla APP:',
|
||||
MSG_ERR_UNKNOWN_VERIFY_CODE: 'Errore durante il salvataggio sul Server. Riprovare piú tardi',
|
||||
@@ -533,29 +511,6 @@ const txt_es = {
|
||||
MSG_ERR_VERIFY_CODE: 'Código de verificación incorrecto!' +
|
||||
emo.EXCLAMATION_MARK +
|
||||
'\nComprueba en el sitio %s y reescribe el nuevo código de 6 dígitos.',
|
||||
MSG_VERIFY_OK: emoji.get('grinning') +
|
||||
' ✅🌈 Benvenuto %s!\n' +
|
||||
'Ti sei correttamente verificato con il BOT. ' +
|
||||
'\nSono il tuo assistente virtuale (BOT).\n\n' +
|
||||
'Questa chat ti servirà per interagire con la Piattaforma e per ricevere delle notifiche Personali.\n' +
|
||||
'' +
|
||||
'(🆘 Per Aiuti, guarda il menu qui sotto)\n\n' +
|
||||
'' +
|
||||
'😍😍😍 Ora sei pronto per Entrare nella APP!\n' +
|
||||
'👉🏻 Clicca qui: %s',
|
||||
MSG_SET_USERNAME: '✨✨✨✨✨✨✨✨✨✨\n' +
|
||||
'🔑 Devi impostare un Username per Telegram:\n' +
|
||||
'\n' +
|
||||
'👉🏻 1. Premi sull\'icona (tre linee orizzontali) del <b>menu principale</b> in alto a sinistra.\n' +
|
||||
'👉🏻 2. Seleziona la voce <b>Impostazioni</b> nel menu.\n' +
|
||||
'👉🏻 3.Premi su <b>Username</b> nella sezione account.\n' +
|
||||
'👉🏻 4. Digita il tuo username. Deve essere un nome ancora libero e non già usato da altri.\n' +
|
||||
'👉🏻 5. Per confermare premi sull\'icona con la spunta in alto a destra.\n' +
|
||||
'🏁 Infine scrivi OK su questa chat. \n\n' +
|
||||
'💬 In questo modo le persone potranno contattarti dalla APP cliccando sull\'icona di Telegram, presente nel tuo profilo.',
|
||||
MSG_SET_USERNAME_OK: '😄😄✅✅ Ottimo! Hai impostato lo Username Telegram!\n\n' +
|
||||
'Ora le persone potranno contattarti su Telegram, anche dalla APP visitando il tuo profilo e cliccando sull\'icona di Telegram, (senza dover pubblicare il proprio numero di cellulare).\n\n' +
|
||||
'Ora puoi proseguire sulla APP.',
|
||||
MSG_SET_PICPROFILE: '🖼 Abbiamo impostato <b>la tua foto del Profilo</b>, copiandola dalla foto profilo di Telegram. Potrai comunque cambiarla dalla APP (%s)',
|
||||
MSG_ERR_UNKNOWN_VERIFY_CODE: 'Error al guardar en el servidor. Inténtalo de nuevo más tarde.',
|
||||
MSG_EXIT_TELEGRAM: 'La cuenta ha sido desconectada de Telegram BOT.',
|
||||
@@ -563,7 +518,7 @@ const txt_es = {
|
||||
' Acaba de registrarse "%s (n. %s)"\n(Invitado de %s)',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ Abilita Nuova Registrazione:',
|
||||
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍♂️ Accetta Ingresso nel GRUPPO %s:',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Abilitato correttamente!',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Abilitato correttamente (da %s)!',
|
||||
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Abilitato correttamente da %s!',
|
||||
MSG_GROUP_CONFIRMED: '✅ Sei stato Aggiunto sul Gruppo %s!',
|
||||
MSG_APORTADOR_DEST_NOT_CONFIRMED: emo.EXCLAMATION_MARK +
|
||||
@@ -589,29 +544,6 @@ const txt_fr = {
|
||||
MSG_ERR_VERIFY_CODE: ' Code de vérification incorrect!' +
|
||||
emo.EXCLAMATION_MARK +
|
||||
'\nControllez sur le site %s et réécrivez le nouveau code à 6 chiffres.',
|
||||
MSG_VERIFY_OK: emoji.get('grinning') +
|
||||
' ✅🌈 Benvenuto %s!\n' +
|
||||
'Ti sei correttamente verificato con il BOT. ' +
|
||||
'\nSono il tuo assistente virtuale (BOT).\n\n' +
|
||||
'Questa chat ti servirà per interagire con la Piattaforma e per ricevere delle notifiche Personali.\n' +
|
||||
'' +
|
||||
'(🆘 Per Aiuti, guarda il menu qui sotto)\n\n' +
|
||||
'' +
|
||||
'😍😍😍 Ora sei pronto per Entrare nella APP!\n' +
|
||||
'👉🏻 Clicca qui: %s',
|
||||
MSG_SET_USERNAME: '✨✨✨✨✨✨✨✨✨✨\n' +
|
||||
'🔑 Devi impostare un Username per Telegram:\n' +
|
||||
'\n' +
|
||||
'👉🏻 1. Premi sull\'icona (tre linee orizzontali) del <b>menu principale</b> in alto a sinistra.\n' +
|
||||
'👉🏻 2. Seleziona la voce <b>Impostazioni</b> nel menu.\n' +
|
||||
'👉🏻 3.Premi su <b>Username</b> nella sezione account.\n' +
|
||||
'👉🏻 4. Digita il tuo username. Deve essere un nome ancora libero e non già usato da altri.\n' +
|
||||
'👉🏻 5. Per confermare premi sull\'icona con la spunta in alto a destra.\n' +
|
||||
'🏁 Infine scrivi OK su questa chat. \n\n' +
|
||||
'💬 In questo modo le persone potranno contattarti dalla APP cliccando sull\'icona di Telegram, presente nel tuo profilo.',
|
||||
MSG_SET_USERNAME_OK: '😄😄✅✅ Ottimo! Hai impostato lo Username Telegram!\n\n' +
|
||||
'Ora le persone potranno contattarti su Telegram, anche dalla APP visitando il tuo profilo e cliccando sull\'icona di Telegram, (senza dover pubblicare il proprio numero di cellulare).\n\n' +
|
||||
'Ora puoi proseguire sulla APP.',
|
||||
MSG_SET_PICPROFILE: '🖼 Abbiamo impostato <b>la tua foto del Profilo</b>, copiandola dalla foto profilo di Telegram. Potrai comunque cambiarla dalla APP (%s)',
|
||||
MSG_ERR_UNKNOWN_VERIFY_CODE: 'Erreur lors de l\'enregistrement sur le serveur. Retentez plus tard',
|
||||
MSG_EXIT_TELEGRAM: 'L\'account a été déconnecté de Telegram BOT.',
|
||||
@@ -619,7 +551,7 @@ const txt_fr = {
|
||||
' Vous venez à peine de vous inscrire "%s (n. %s) %s',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ Abilita Nuova Registrazione:',
|
||||
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍♂️ Accetta Ingresso nel GRUPPO %s:',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Abilitato correttamente!',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Abilitato correttamente (da %s)!',
|
||||
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Abilitato correttamente da %s!',
|
||||
MSG_GROUP_CONFIRMED: '✅ Sei stato Aggiunto sul Gruppo %s!',
|
||||
MSG_APORTADOR_DEST_NOT_CONFIRMED: emo.EXCLAMATION_MARK +
|
||||
@@ -643,29 +575,6 @@ const txt_si = {
|
||||
MSG_VERIFY_CODE: '1. Vrni se na spletno strani: \n%s\n2. Kopiraj kodo Authenticazione (6 mestno) ki jo najdeš zgoraj zapisano\n3. Napiši (ali prilepi) tu spodaj kot sporočilo: ',
|
||||
MSG_ERR_VERIFY_CODE: 'Napačna koda za preverjanje!' + emo.EXCLAMATION_MARK +
|
||||
'\nPreveri na strani %s in ponovno napiši 6 mestno kodo.',
|
||||
MSG_VERIFY_OK: emoji.get('grinning') +
|
||||
' ✅🌈 Benvenuto %s!\n' +
|
||||
'Ti sei correttamente verificato con il BOT. ' +
|
||||
'\nSono il tuo assistente virtuale (BOT).\n\n' +
|
||||
'Questa chat ti servirà per interagire con la Piattaforma e per ricevere delle notifiche Personali.\n' +
|
||||
'' +
|
||||
'(🆘 Per Aiuti, guarda il menu qui sotto)\n\n' +
|
||||
'' +
|
||||
'😍😍😍 Ora sei pronto per Entrare nella APP!\n' +
|
||||
'👉🏻 Clicca qui: %s',
|
||||
MSG_SET_USERNAME: '✨✨✨✨✨✨✨✨✨✨\n' +
|
||||
'🔑 Devi impostare un Username per Telegram:\n' +
|
||||
'\n' +
|
||||
'👉🏻 1. Premi sull\'icona (tre linee orizzontali) del <b>menu principale</b> in alto a sinistra.\n' +
|
||||
'👉🏻 2. Seleziona la voce <b>Impostazioni</b> nel menu.\n' +
|
||||
'👉🏻 3.Premi su <b>Username</b> nella sezione account.\n' +
|
||||
'👉🏻 4. Digita il tuo username. Deve essere un nome ancora libero e non già usato da altri.\n' +
|
||||
'👉🏻 5. Per confermare premi sull\'icona con la spunta in alto a destra.\n' +
|
||||
'🏁 Infine scrivi OK su questa chat. \n\n' +
|
||||
'💬 In questo modo le persone potranno contattarti dalla APP cliccando sull\'icona di Telegram, presente nel tuo profilo.',
|
||||
MSG_SET_USERNAME_OK: '😄😄✅✅ Ottimo! Hai impostato lo Username Telegram!\n\n' +
|
||||
'Ora le persone potranno contattarti su Telegram, anche dalla APP visitando il tuo profilo e cliccando sull\'icona di Telegram, (senza dover pubblicare il proprio numero di cellulare).\n\n' +
|
||||
'Ora puoi proseguire sulla APP.',
|
||||
MSG_SET_PICPROFILE: '🖼 Abbiamo impostato <b>la tua foto del Profilo</b>, copiandola dalla foto profilo di Telegram. Potrai comunque cambiarla dalla APP (%s)',
|
||||
MSG_ERR_UNKNOWN_VERIFY_CODE: 'Napaka strežnika.Poskusi kasneje ',
|
||||
MSG_EXIT_TELEGRAM: 'Račun se nahaja v programu Telegram BOT.',
|
||||
@@ -673,7 +582,7 @@ const txt_si = {
|
||||
'Registracija registracije %s (n. %s)\n(povabil ga %s)',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ Abilita Nuova Registrazione:',
|
||||
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍♂️ Accetta Ingresso nel GRUPPO %s:',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Abilitato correttamente!',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Abilitato correttamente (da %s)!',
|
||||
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Abilitato correttamente da %s!',
|
||||
MSG_GROUP_CONFIRMED: '✅ Sei stato Aggiunto sul Gruppo %s!',
|
||||
MSG_APORTADOR_DEST_NOT_CONFIRMED: emo.EXCLAMATION_MARK +
|
||||
@@ -696,29 +605,6 @@ const txt_en = {
|
||||
'3. Write it (or paste it) below as a message:',
|
||||
MSG_ERR_VERIFY_CODE: 'Incorrect Verification Code!' + emo.EXCLAMATION_MARK +
|
||||
'\nCheck on the site %s and rewrite the new 6-digit code.',
|
||||
MSG_VERIFY_OK: emoji.get('grinning') +
|
||||
' ✅🌈 Benvenuto %s!\n' +
|
||||
'Ti sei correttamente verificato con il BOT. ' +
|
||||
'\nSono il tuo assistente virtuale (BOT).\n\n' +
|
||||
'Questa chat ti servirà per interagire con la Piattaforma e per ricevere delle notifiche Personali.\n' +
|
||||
'' +
|
||||
'(🆘 Per Aiuti, guarda il menu qui sotto)\n\n' +
|
||||
'' +
|
||||
'😍😍😍 Ora sei pronto per Entrare nella APP!\n' +
|
||||
'👉🏻 Clicca qui: %s',
|
||||
MSG_SET_USERNAME: '✨✨✨✨✨✨✨✨✨✨\n' +
|
||||
'🔑 Devi impostare un Username per Telegram:\n' +
|
||||
'\n' +
|
||||
'👉🏻 1. Premi sull\'icona (tre linee orizzontali) del <b>menu principale</b> in alto a sinistra.\n' +
|
||||
'👉🏻 2. Seleziona la voce <b>Impostazioni</b> nel menu.\n' +
|
||||
'👉🏻 3.Premi su <b>Username</b> nella sezione account.\n' +
|
||||
'👉🏻 4. Digita il tuo username. Deve essere un nome ancora libero e non già usato da altri.\n' +
|
||||
'👉🏻 5. Per confermare premi sull\'icona con la spunta in alto a destra.\n' +
|
||||
'🏁 Infine scrivi OK su questa chat. \n\n' +
|
||||
'💬 In questo modo le persone potranno contattarti dalla APP cliccando sull\'icona di Telegram, presente nel tuo profilo.',
|
||||
MSG_SET_USERNAME_OK: '😄😄✅✅ Ottimo! Hai impostato lo Username Telegram!\n\n' +
|
||||
'Ora le persone potranno contattarti su Telegram, anche dalla APP visitando il tuo profilo e cliccando sull\'icona di Telegram, (senza dover pubblicare il proprio numero di cellulare).\n\n' +
|
||||
'Ora puoi proseguire sulla APP.',
|
||||
MSG_SET_PICPROFILE: '🖼 Abbiamo impostato <b>la tua foto del Profilo</b>, copiandola dalla foto profilo di Telegram. Potrai comunque cambiarla dalla APP (%s)',
|
||||
MSG_ERR_UNKNOWN_VERIFY_CODE: 'Error while saving to the Server. Try again later',
|
||||
MSG_EXIT_TELEGRAM: 'The account has now been disconnected from this Telegram BOT.',
|
||||
@@ -726,7 +612,7 @@ const txt_en = {
|
||||
' He/She\'s just registered "%s (n. %s)"\n(Invited from %s)',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ Abilita Nuova Registrazione:',
|
||||
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍♂️ Accetta Ingresso nel GRUPPO %s:',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Abilitato correttamente!',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Abilitato correttamente (da %s)!',
|
||||
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Abilitato correttamente da %s!',
|
||||
MSG_GROUP_CONFIRMED: '✅ Sei stato Aggiunto sul Gruppo %s!',
|
||||
MSG_APORTADOR_DEST_NOT_CONFIRMED: emo.EXCLAMATION_MARK +
|
||||
@@ -752,29 +638,6 @@ const txt_pt = {
|
||||
MSG_ERR_VERIFY_CODE: 'Código de Verificação Incorrecto!' +
|
||||
emo.EXCLAMATION_MARK +
|
||||
'\nCódigo de Verificação ErradoCheque no local %s e reescreva o novo código de 6 dígitos.',
|
||||
MSG_VERIFY_OK: emoji.get('grinning') +
|
||||
' ✅🌈 Benvenuto %s!\n' +
|
||||
'Ti sei correttamente verificato con il BOT. ' +
|
||||
'\nSono il tuo assistente virtuale (BOT).\n\n' +
|
||||
'Questa chat ti servirà per interagire con la Piattaforma e per ricevere delle notifiche Personali.\n' +
|
||||
'' +
|
||||
'(🆘 Per Aiuti, guarda il menu qui sotto)\n\n' +
|
||||
'' +
|
||||
'😍😍😍 Ora sei pronto per Entrare nella APP!\n' +
|
||||
'👉🏻 Clicca qui: %s',
|
||||
MSG_SET_USERNAME: '✨✨✨✨✨✨✨✨✨✨\n' +
|
||||
'🔑 Devi impostare un Username per Telegram:\n' +
|
||||
'\n' +
|
||||
'👉🏻 1. Premi sull\'icona (tre linee orizzontali) del <b>menu principale</b> in alto a sinistra.\n' +
|
||||
'👉🏻 2. Seleziona la voce <b>Impostazioni</b> nel menu.\n' +
|
||||
'👉🏻 3.Premi su <b>Username</b> nella sezione account.\n' +
|
||||
'👉🏻 4. Digita il tuo username. Deve essere un nome ancora libero e non già usato da altri.\n' +
|
||||
'👉🏻 5. Per confermare premi sull\'icona con la spunta in alto a destra.\n' +
|
||||
'🏁 Infine scrivi OK su questa chat. \n\n' +
|
||||
'💬 In questo modo le persone potranno contattarti dalla APP cliccando sull\'icona di Telegram, presente nel tuo profilo.',
|
||||
MSG_SET_USERNAME_OK: '😄😄✅✅ Ottimo! Hai impostato lo Username Telegram!\n\n' +
|
||||
'Ora le persone potranno contattarti su Telegram, anche dalla APP visitando il tuo profilo e cliccando sull\'icona di Telegram, (senza dover pubblicare il proprio numero di cellulare).\n\n' +
|
||||
'Ora puoi proseguire sulla APP.',
|
||||
MSG_SET_PICPROFILE: '🖼 Abbiamo impostato <b>la tua foto del Profilo</b>, copiandola dalla foto profilo di Telegram. Potrai comunque cambiarla dalla APP (%s)',
|
||||
MSG_ERR_UNKNOWN_VERIFY_CODE: 'Erro ao salvar no Servidor. Tente novamente mais tarde.',
|
||||
MSG_EXIT_TELEGRAM: 'A conta foi agora desconectada deste Telegrama BOT.',
|
||||
@@ -782,8 +645,7 @@ const txt_pt = {
|
||||
' Acabou de se registar "%s (n. %s)"\n(Convidado por %s)',
|
||||
MSG_APORTADOR_ASK_CONFIRM: '🆕💥 🧍♂️ Abilita Nuova Registrazione:',
|
||||
MSG_ACCEPT_NEWENTRY_INGROUP: '❇️👥 🧍♂️ Accetta Ingresso nel GRUPPO %s:',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Abilitato correttamente!' +
|
||||
'Vai sulla App oppure clicca qui per entrare 👉🏻 %s',
|
||||
MSG_APORTADOR_CONFIRMED: '✅ %s è stato Abilitato correttamente (da %s)!',
|
||||
MSG_APORTADOR_DEST_CONFIRMED: '✅ Sei stato Abilitato correttamente da %s!',
|
||||
MSG_GROUP_CONFIRMED: '✅ Sei stato Aggiunto sul Gruppo %s!',
|
||||
MSG_APORTADOR_DEST_NOT_CONFIRMED: emo.EXCLAMATION_MARK +
|
||||
@@ -1533,8 +1395,8 @@ class Telegram {
|
||||
await User.setUsernameTelegram(this.idapp, rec.user._id,
|
||||
msg.from.username || '', msg.from.first_name || '',
|
||||
msg.from.last_name || '');
|
||||
await this.sendMsg(msg.from.id,
|
||||
printf(getstr(rec.user.lang, 'MSG_SET_USERNAME_OK')));
|
||||
|
||||
await this.sendMsgByTemplate('MSG_SET_USERNAME_OK', rec.user);
|
||||
|
||||
if (!rec.user.verified_by_aportador) {
|
||||
MyTelegramBot.askConfirmationUser(this.idapp, shared_consts.CallFunz.REGISTRATION, rec.user);
|
||||
@@ -1685,6 +1547,7 @@ class Telegram {
|
||||
noanswer = true;
|
||||
let myfaq = this.geturlfaq();
|
||||
risp = 'Io sono solo un Robot ' + emo.ROBOT_FACE + emo.JOY2 +
|
||||
'Usa il menu qui sotto per interagire col BOT\n' +
|
||||
'\n\nPer AIUTO, clicca qui:\n👉🏻👉🏻<a href="' + myfaq +
|
||||
'">FAQ di AIUTO</a> (risposte alle domande più frequenti)\n\nSe non trovi risposta allora contatta la Chat HELP.\nGrazie';
|
||||
// risp += '\nClicca qui per entrare nella Chat - HELP di Supporto\n' + 'https://t.me/joinchat/AL2qKE80rxDkgbeMGO-0bw' + '\n\nI miei colleghi umani ti aiuteranno a risolvere !';
|
||||
@@ -2474,11 +2337,21 @@ class Telegram {
|
||||
}
|
||||
}
|
||||
|
||||
async checkIfUsernameTelegramSet(msg, recuser) {
|
||||
async sendMsgByTemplate(title, myuser) {
|
||||
|
||||
try {
|
||||
const msg = await MsgTemplate.getMsgByTitleAndLang(myuser.idapp, title, myuser.lang);
|
||||
const mytext = tools.convertSpecialTags(myuser, msg.body);
|
||||
return this.sendMsg(myuser.profile.teleg_id, mytext);
|
||||
}catch (e) {
|
||||
console.error('ERR sendMsgByTemplate', e);
|
||||
}
|
||||
}
|
||||
|
||||
async checkIfUsernameTelegramSet(msg, myuser) {
|
||||
try {
|
||||
if (!msg.from.username) {
|
||||
//
|
||||
return this.sendMsg(msg.from.id, printf(getstr(recuser.lang, 'MSG_SET_USERNAME')));
|
||||
await this.sendMsgByTemplate('MSG_SET_USERNAME', myuser);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('e');
|
||||
@@ -2520,7 +2393,6 @@ class Telegram {
|
||||
console.log(recuser.username, ' SI E\' VERIFICATO CON TELEGRAM !');
|
||||
let username = recuser.name;
|
||||
|
||||
// this.sendMsgLog(msg.from.id, printf(getstr(recuser.lang, 'MSG_VERIFY_OK'), username, tools.getHostByIdApp(this.idapp)));
|
||||
if (!!msg.from.username) {
|
||||
await MyTelegramBot.askConfirmationUser(this.idapp, shared_consts.CallFunz.REGISTRATION, recuser);
|
||||
} else {
|
||||
@@ -3259,8 +3131,9 @@ class Telegram {
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
console.log('textORIG', text);
|
||||
text = text.replace(/<br>/g, '\n');
|
||||
text = text.replace(/<br\/>/g, '\n');
|
||||
text = text.replace(/<div>/g, '');
|
||||
text = text.replace(/<font/g, '<pre');
|
||||
text = text.replace(/<\/font>/g, '</pre>');
|
||||
@@ -3269,6 +3142,7 @@ class Telegram {
|
||||
text = text.replace(/<p /g, '<pre ');
|
||||
text = text.replace(/<\/p>/g, '</pre>');
|
||||
text = text.replace(/<\/div>/g, '\n');
|
||||
// text = text.replace(/<\/div>/g, '');
|
||||
text = text.replace(/ /g, ' ');
|
||||
|
||||
if (!form) {
|
||||
@@ -3297,7 +3171,7 @@ class Telegram {
|
||||
return 0;
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
console.error(e, 'text', text);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -3323,6 +3197,8 @@ class Telegram {
|
||||
|
||||
async sendMsg(id, text, menu, form, msg_id, chat_id, ripr_menuPrec) {
|
||||
|
||||
if (!id)
|
||||
return false;
|
||||
try {
|
||||
|
||||
if (text.length > 4090) {
|
||||
@@ -3412,6 +3288,21 @@ class Telegram {
|
||||
// console.log('2) myfileprofile', pathfile);
|
||||
return tools.downloadImage(photo_url, myfileprofile).
|
||||
then((ris) => {
|
||||
|
||||
try {
|
||||
let resized_img_small = tools.extractFilePath(myfileprofile) + '/' + server_constants.PREFIX_IMG_SMALL + filename;
|
||||
// SMALL
|
||||
|
||||
// questa opzione 'failOnError' serve per risolvere l'errore (Error: VipsJpeg: Invalid SOS parameters for sequential JPEG
|
||||
sharp(myfileprofile, {failOnError: false}).
|
||||
resize(64, 64).
|
||||
withMetadata().
|
||||
toFile(resized_img_small);
|
||||
}catch (e) {
|
||||
console.error('setPhotoProfile sharp', e);
|
||||
}
|
||||
|
||||
|
||||
// console.log('3) setPicProfile ris', ris);
|
||||
return User.setPicProfile(idapp, username, filename).
|
||||
then((ris) => {
|
||||
@@ -3686,10 +3577,8 @@ if (true) {
|
||||
|
||||
await User.setaportador_solidario(user.idapp, data.username, userDest.username);
|
||||
|
||||
const msgOrig = printf(getstr(userDest.lang, 'MSG_APORTADOR_DEST_CONFIRMED'), `${userDest.username}`,
|
||||
tools.getHostByIdApp(user.idapp));
|
||||
const msgDest = printf(getstr(user.lang, 'MSG_APORTADOR_CONFIRMED'),
|
||||
`${user.username}`);
|
||||
const msgOrig = printf(getstr(userDest.lang, 'MSG_APORTADOR_DEST_CONFIRMED'), `${userDest.username}`, tools.getHostByIdApp(user.idapp));
|
||||
const msgDest = printf(getstr(user.lang, 'MSG_APORTADOR_CONFIRMED'), `${user.username}`, `${userDest.username}`);
|
||||
|
||||
await local_sendMsgTelegram(user.idapp, data.username, msgOrig);
|
||||
await local_sendMsgTelegram(user.idapp, data.userDest, msgDest);
|
||||
|
||||
@@ -2708,8 +2708,7 @@ module.exports = {
|
||||
msg = msg.replace('{username}', user.username);
|
||||
msg = msg.replace('{name}', user.name ? user.name : user.username);
|
||||
msg = msg.replace('{surname}', user.surname ? user.surname : '');
|
||||
msg = msg.replace('{aportador_solidario}',
|
||||
user.aportador_solidario ? user.aportador_solidario : '');
|
||||
msg = msg.replace('{aportador_solidario}', user.aportador_solidario ? user.aportador_solidario : '');
|
||||
if (!!user.profile.link_payment)
|
||||
msg = msg.replace('{link_paypalme}', user.profile.link_payment);
|
||||
if (!!user.profile.revolut)
|
||||
|
||||
@@ -222,6 +222,22 @@ module.exports = {
|
||||
addquery = {username: params.usernameDest};
|
||||
} else if (params.typemsg === shared_consts.TypeMsg.SEND_TO_MYSELF) {
|
||||
addquery = {username: params.usernameDest};
|
||||
} else if (params.typemsg === shared_consts.TypeMsg.SEND_TO_TELEG_NO_USERNAME_TELEG) {
|
||||
addquery = {
|
||||
'profile.teleg_id': {$gt: 1},
|
||||
$or: [
|
||||
{'profile.username_telegram': {$exists: false}},
|
||||
{'profile.username_telegram': {$exists: true, $eq: ''}}],
|
||||
};
|
||||
} else if (params.typemsg === shared_consts.TypeMsg.SEND_TO_TELEG_NO_VERIF_BY_APORTADOR) {
|
||||
addquery = {
|
||||
'profile.teleg_id': {$gt: 1},
|
||||
'profile.username_telegram': {$exists: true},
|
||||
$expr: { $gt: [ { $strLenCP: "$profile.username_telegram" }, 3 ] },
|
||||
$or: [
|
||||
{'verified_by_aportador': {$exists: false}},
|
||||
{'verified_by_aportador': {$exists: true, $eq: false}}],
|
||||
};
|
||||
} else if (params.typemsg === shared_consts.TypeMsg.SEND_TO_GROUP) {
|
||||
if (params.groupnameDest) {
|
||||
addquery = {
|
||||
@@ -283,8 +299,8 @@ module.exports = {
|
||||
nummsgsent++;
|
||||
}
|
||||
|
||||
if ((nummsgsent % 100) === 0) {
|
||||
console.log('Inviati ', nummsgsent, 'messaggi...')
|
||||
if (nummsgsent > 0 && (nummsgsent % 100) === 0) {
|
||||
console.log('Inviati ', nummsgsent, 'messaggi...');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,6 +205,8 @@ module.exports = {
|
||||
SEND_TO_USER: 25,
|
||||
SEND_TO_GROUP: 30,
|
||||
SEND_TO_MYSELF: 40,
|
||||
SEND_TO_TELEG_NO_USERNAME_TELEG: 50,
|
||||
SEND_TO_TELEG_NO_VERIF_BY_APORTADOR: 60,
|
||||
},
|
||||
|
||||
TypeMsg_Actions: {
|
||||
|
||||
Reference in New Issue
Block a user