Abilitazione del BOT
This commit is contained in:
@@ -1804,7 +1804,7 @@ module.exports = {
|
||||
|
||||
getTelegramBotNameByIdApp: function (idapp) {
|
||||
const myapp = this.MYAPPS.find((item) => item.idapp === idapp);
|
||||
if (process.env.NODE_ENV === 'test')
|
||||
if (process.env.NODE_ENV === 'test' || process.env.NODE_ENV === 'development')
|
||||
return (myapp) ? myapp.telegram_bot_name_test : '';
|
||||
else
|
||||
return (myapp) ? myapp.telegram_bot_name : '';
|
||||
@@ -1823,12 +1823,30 @@ module.exports = {
|
||||
|
||||
getTelegramKeyByIdApp: function (idapp) {
|
||||
const myapp = this.MYAPPS.find((item) => item.idapp === idapp);
|
||||
if (process.env.NODE_ENV === 'test')
|
||||
if (process.env.NODE_ENV === 'test' || process.env.NODE_ENV === 'development')
|
||||
return (myapp) ? myapp.telegram_key_test : '';
|
||||
else
|
||||
return (myapp) ? myapp.telegram_key : '';
|
||||
},
|
||||
|
||||
getArrTelegramFromSite: function () {
|
||||
const myapp = this.MYAPPS;
|
||||
let arrteleg = []
|
||||
for (const site of myapp) {
|
||||
if (site.active) {
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
if (myapp.load_process_telegram_test)
|
||||
arrteleg.push(myapp.idapp)
|
||||
} else {
|
||||
if (myapp.load_process_telegram)
|
||||
arrteleg.push(myapp.idapp)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return arrteleg;
|
||||
},
|
||||
|
||||
getLookupPipeLine(params, proj) {
|
||||
|
||||
let myquery = [
|
||||
@@ -4025,7 +4043,11 @@ module.exports = {
|
||||
if (!msg)
|
||||
return msg;
|
||||
|
||||
|
||||
if (!!user) {
|
||||
if (msg.includes('{host}')) {
|
||||
msg = msg.replace('{host}', this.getHostByIdApp(user.idapp));
|
||||
}
|
||||
if (msg.includes('{appname}'))
|
||||
msg = msg.replace('{appname}', this.getNomeAppByIdApp(user.idapp));
|
||||
msg = msg.replace('{username}', user.username);
|
||||
|
||||
Reference in New Issue
Block a user