diff --git a/src/server/telegram/telegrambot.js b/src/server/telegram/telegrambot.js index 1f91609..a4cb8c5 100755 --- a/src/server/telegram/telegrambot.js +++ b/src/server/telegram/telegrambot.js @@ -488,6 +488,7 @@ const txt = { MSG_ACCEPT_NEWENTRY_INGROUP: 'โ‡๏ธ๐Ÿ‘ฅ ๐Ÿงโ€โ™‚๏ธ Accetta Ingresso nel GRUPPO %s:', MSG_FRIENDS_ACCEPTED: 'โœ… %s ha accettato la tua richiesta di Amicizia !', MSG_FRIENDS_ACCEPTED_CONFIRMED: 'โœ… Hai accettato la richiesta di Amicizia di %s !', + MSG_FRIENDS_NOT_ACCEPTED_CONFIRMED: '๐Ÿšซ Hai rifiutato la richiesta di Amicizia di %s !', MSG_APORTADOR_CONFIRMED: 'โœ… %s รจ stato Abilitato correttamente (da %s)!', MSG_APORTADOR_DEST_CONFIRMED: 'โœ… Sei stato Abilitato correttamente da %s!\n' + 'Vai sulla App oppure clicca qui per entrare\n๐Ÿ‘‰๐Ÿป %s', @@ -877,7 +878,7 @@ const MyTelegramBot = { if (myfunc === shared_consts.CallFunz.RICHIESTA_AMICIZIA) { - domanda = printf(tools.gettranslate('RICHIESTA_AMICIZIA', langdest), userDest) + '
' + struserinfomsg; + domanda = printf(tools.gettranslate('RICHIESTA_AMICIZIA', langdest), myuser.username) + '
' + struserinfomsg; keyb = cl.getInlineKeyboard(myuser.lang, [ { @@ -3697,6 +3698,24 @@ if (true) { } + } + } else if (data.action === InlineConferma.RISPOSTA_NO + shared_consts.CallFunz.RICHIESTA_AMICIZIA) { + + if (userDest) { + cmd = shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS; + const foundIfAlreadyFriend = await User.isMyFriend(user.idapp, data.username, data.userDest); + + if (foundIfAlreadyFriend) { + // Aggiungilo nelle Amicizie + const ris = await User.setFriendsCmd(user.idapp, data.username, data.userDest, cmd); + if (ris) { + const msgDest = printf(getstr(user.lang, 'MSG_FRIENDS_NOT_ACCEPTED_CONFIRMED'), data.username); + + await local_sendMsgTelegram(user.idapp, data.userDest, msgDest); + } + + } + } } }