"Autoprodotto": metterlo come campo e filtro a parte ??
Se non hai l'USERNAME TELEGRAM presente, allora il BOT ti deve dire come fare per impostarlo. Creare una Chat di Help Supporto Tecnico
This commit is contained in:
@@ -458,8 +458,27 @@ const txt = {
|
||||
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! Ti sei correttamente verificato con il BOT. ' +
|
||||
'\nSono il tuo assistente virtuale.\n',
|
||||
' ✅🌈 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!',
|
||||
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_ERR_UNKNOWN_VERIFY_CODE: 'Errore durante il salvataggio sul Server. Riprovare piú tardi',
|
||||
MSG_EXIT_TELEGRAM: 'L\'account è stato ora scollegato da questo Telegram BOT.',
|
||||
MSG_APORTADOR_USER_REGISTERED: emo.FIRE + ' Si è appena Registrato "%s" (n. %s)\nInvitato da %s',
|
||||
@@ -1413,6 +1432,12 @@ class Telegram {
|
||||
return tools.getHostByIdApp(this.idapp) + '/faq';
|
||||
}
|
||||
|
||||
getstrChatHelp() {
|
||||
return 'Clicca qui per entrare nella Chat HELP di Supporto\n' +
|
||||
tools.getTelegramSupportChat(this.idapp) +
|
||||
'\n\nI miei colleghi umani ti aiuteranno a risolvere !';
|
||||
}
|
||||
|
||||
async IsTesto(msg) {
|
||||
|
||||
let risp = '';
|
||||
@@ -1480,6 +1505,25 @@ class Telegram {
|
||||
|
||||
const menusite = await this.isMenuSite(this.idapp, testo, lang, id);
|
||||
|
||||
if (rec.status === Status.VERIFIED) {
|
||||
if (rec.user) {
|
||||
if (rec.user.profile.username_telegram && msg.from.id > 0 && !msg.from.username) {
|
||||
rec.user.profile.username_telegram = msg.from.username
|
||||
await User.setUsernameTelegram(this.idapp, rec.user._id, msg.from.username || '', msg.from.first_name || '', msg.from.last_name || '');
|
||||
}
|
||||
|
||||
if (!rec.user.profile.username_telegram && msg.from.username) {
|
||||
rec.user.profile.username_telegram = msg.from.username
|
||||
await User.setUsernameTelegram(this.idapp, rec.user._id, msg.from.username || '', msg.from.first_name || '', msg.from.last_name || '');
|
||||
this.sendMsg(msg.from.id, printf(getstr(rec.user.lang, 'MSG_SET_USERNAME_OK')));
|
||||
} else {
|
||||
if (!rec.user.profile.username_telegram) {
|
||||
return this.checkIfUsernameTelegramSet(msg, rec.user);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (risp === '') {
|
||||
if (menusite) {
|
||||
risp = this.getValueMenu(this.idapp, testo, lang);
|
||||
@@ -1561,9 +1605,7 @@ class Telegram {
|
||||
'il più grande esperimento dell\'Uomo di ipnosi di massa, riempiendo di bugie i media mondiali, che servono sostanzialmente a controllare i popoli.' +
|
||||
'E con questo ti ho detto tutto. :D ';
|
||||
} else if (MsgBot.AIUTO.find((rec) => testo.indexOf(rec) > -1)) {
|
||||
risp = 'Clicca qui per entrare nella Chat HELP di Supporto\n' +
|
||||
tools.HELP_CHAT +
|
||||
'\n\nI miei colleghi umani ti aiuteranno a risolvere !';
|
||||
risp = this.getstrChatHelp();
|
||||
} else if (MsgBot.SPOSAMI.find((rec) => testo.indexOf(rec) > -1)) {
|
||||
risp = 'No Grazie! Sono per la Libertà a Vita! ' + emo.JOY +
|
||||
'\nMa se vuoi possiamo conoscerci meglio!' + emo.DANCER + emo.FIRE;
|
||||
@@ -2375,6 +2417,20 @@ class Telegram {
|
||||
}
|
||||
}
|
||||
|
||||
checkIfUsernameTelegramSet(msg, recuser) {
|
||||
try {
|
||||
if (!msg.from.username) {
|
||||
//
|
||||
this.sendMsg(msg.from.id,
|
||||
printf(getstr(recuser.lang, 'MSG_SET_USERNAME')));
|
||||
|
||||
return true;
|
||||
}
|
||||
}catch (e) {
|
||||
console.error('e');
|
||||
}
|
||||
}
|
||||
|
||||
async setVerifyCode(msg) {
|
||||
try {
|
||||
if (!!msg.text) {
|
||||
@@ -2407,6 +2463,8 @@ class Telegram {
|
||||
let name = recuser.name;
|
||||
this.sendMsg(msg.from.id,
|
||||
printf(getstr(recuser.lang, 'MSG_VERIFY_OK'), name));
|
||||
|
||||
this.checkIfUsernameTelegramSet(msg, recuser);
|
||||
// local_sendMsgTelegramToTheManagers(this.idapp, recuser.name + ' ' + recuser.surname + ' si è Verificato a Telegram BOT! (lang=' + recuser.lang + ')' + emo.STARS, msg);
|
||||
} else {
|
||||
this.sendMsg(msg.from.id,
|
||||
@@ -2788,8 +2846,7 @@ class Telegram {
|
||||
await this.isMenu(rec, msg);
|
||||
}
|
||||
} else {
|
||||
await
|
||||
this.isMenuNotVerified(rec, msg);
|
||||
await this.isMenuNotVerified(rec, msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3170,16 +3227,20 @@ class Telegram {
|
||||
|
||||
async sendMsg(id, text, menu, form, msg_id, chat_id, ripr_menuPrec) {
|
||||
|
||||
if (text.length > 4090) {
|
||||
let text1 = text.slice(0, 4090);
|
||||
let text2 = text.slice(4090, text.length);
|
||||
await this._inviaMsg(id, text1, form, menu, msg_id, chat_id,
|
||||
ripr_menuPrec);
|
||||
return await this._inviaMsg(id, text2, form, menu, msg_id, chat_id,
|
||||
ripr_menuPrec);
|
||||
} else {
|
||||
return await this._inviaMsg(id, text, form, menu, msg_id, chat_id,
|
||||
ripr_menuPrec);
|
||||
try {
|
||||
if (text.length > 4090) {
|
||||
let text1 = text.slice(0, 4090);
|
||||
let text2 = text.slice(4090, text.length);
|
||||
await this._inviaMsg(id, text1, form, menu, msg_id, chat_id,
|
||||
ripr_menuPrec);
|
||||
return await this._inviaMsg(id, text2, form, menu, msg_id, chat_id,
|
||||
ripr_menuPrec);
|
||||
} else {
|
||||
return await this._inviaMsg(id, text, form, menu, msg_id, chat_id,
|
||||
ripr_menuPrec);
|
||||
}
|
||||
}catch (e) {
|
||||
console.error('Error sendMsg', e);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3317,6 +3378,7 @@ if (true) {
|
||||
try {
|
||||
const token = tools.getTelegramKeyByIdApp(idapp);
|
||||
const nomebot = tools.getTelegramBotNameByIdApp(idapp);
|
||||
|
||||
// console.log('idapp', idapp, 'token', token);
|
||||
|
||||
if (!!token) {
|
||||
|
||||
Reference in New Issue
Block a user