From 21192c971c0ff76c67670c19a62e186f263e1712 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 25 Dec 2019 17:30:32 +0100 Subject: [PATCH] Announcements via Reference Parent --- Session.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Session.js b/Session.js index 23aeb4fe3..17788d20b 100644 --- a/Session.js +++ b/Session.js @@ -485,10 +485,7 @@ let socialBot = bot.SESSION.socialBots.bots[i] try { let code = JSON.parse(announcement.code) - if (code.botId === undefined) { - code.botId = socialBot.id - } - if (socialBot.type === code.botType && socialBot.id === code.botId) { + if (socialBot.id === announcement.referenceParent.id) { if (socialBot.type === "Telegram Bot") { if (announcement.formulaValue !== undefined) { socialBot.botInstance.telegramAPI.sendMessage(socialBot.botInstance.chatId, announcement.formulaValue).catch(err => parentLogger.write(MODULE_NAME, "[WARN] initialize -> setUpSocialBots -> announce -> Telegram API error -> err = " + err))