diff --git a/Session.js b/Session.js index 872258aad..87756700e 100644 --- a/Session.js +++ b/Session.js @@ -512,7 +512,7 @@ for (let i = 0; i < bot.SESSION.socialBots.bots.length; i++) { let socialBot = bot.SESSION.socialBots.bots[i] try { - let code = JSON.parse(announcement.code) + let code = announcement.code if (socialBot.id === announcement.referenceParent.id) { if (socialBot.type === "Telegram Bot") { if (announcement.formulaValue !== undefined) { diff --git a/TradingSimulation.js b/TradingSimulation.js index 9340b2126..f1c60b942 100644 --- a/TradingSimulation.js +++ b/TradingSimulation.js @@ -2746,7 +2746,9 @@ } announcement.formulaValue = formulaValue - bot.SESSION.socialBots.announce(announcement) + if (bot.SESSION.socialBots !== undefined) { + bot.SESSION.socialBots.announce(announcement) + } } } }