Lista Doni Navi

This commit is contained in:
Paolo Arena
2020-03-21 10:28:26 +01:00
parent fbc85ce06a
commit b2696d1898
139 changed files with 463 additions and 80 deletions

16
src/server/telegram/telegrambot.js Normal file → Executable file
View File

@@ -333,6 +333,14 @@ module.exports = {
}
nummsgsent++;
}
if ((nummsgsent === 1) && (mydata.inviareale)) {
try {
this.sendMsgTelegramToTheManagers(idapp, 'Inviato messaggio a tutti i Donatori della Nave ' + mydata.navemediatore.riga + '.' + mydata.navemediatore.col + '\n' + mymsg)
}catch (e) {
}
}
}
}
@@ -353,13 +361,17 @@ module.exports = {
}
},
sendMsgTelegramToTheAdmin: async function (idapp, text) {
sendMsgTelegramToTheAdmin: async function (idapp, text, senzaintestazione) {
const usersmanagers = await User.getusersManagers(idapp);
let intestaz = emo.ROBOT_FACE + '[BOT-ADMIN]' + emo.ADMIN + ': ';
if (senzaintestazione)
intestaz = '';
if (usersmanagers) {
for (const rec of usersmanagers) {
if (User.isAdmin(rec.perm)) {
this.sendMsgTelegramByIdTelegram(idapp, rec.profile.teleg_id, emo.ROBOT_FACE + '[BOT-ADMIN]' + emo.ADMIN + ': ' + text, undefined, undefined, true);
this.sendMsgTelegramByIdTelegram(idapp, rec.profile.teleg_id, intestaz + text, undefined, undefined, true);
await tools.snooze(300)
}
}