From 5303f0672c6369e7a81f1542e0d6fd9b6dc7dd80 Mon Sep 17 00:00:00 2001 From: Brett Taylor Date: Tue, 11 May 2021 00:01:16 -0400 Subject: [PATCH] pass in config --- .../Bot-Modules/Trading-Bot/Announcements/DiscordBot.js | 8 ++++---- .../Bot-Modules/Trading-Bot/Announcements/SocialBots.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/DiscordBot.js b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/DiscordBot.js index a437dd220..abc1f2fb7 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/DiscordBot.js +++ b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/DiscordBot.js @@ -13,21 +13,21 @@ exports.newSuperalgosBotModulesDiscordBot = function (processIndex) { return thisObject - function initialize(webhookURL,format) { + function initialize(config) { /* Discord Bot Initialization */ try { - thisObject.webhookURL = webhookURL + thisObject.webhookURL = config.webhookURL thisObject.taskParameters = { exchange: TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.parentNode.parentNode.name, market: TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.baseAsset.referenceParent.config.codeName + '/' + TS.projects.superalgos.globals.taskConstants.TASK_NODE.parentNode.parentNode.parentNode.referenceParent.quotedAsset.referenceParent.config.codeName } - if (format === undefined) { + if (config.format === undefined) { thisObject.format = "%{MESSAGE}" } else { - thisObject.format = format + thisObject.format = config.format } } catch (err) { logError("initialize -> err = " + err.stack); diff --git a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/SocialBots.js b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/SocialBots.js index 5984601ee..4fd29c7f2 100644 --- a/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/SocialBots.js +++ b/Projects/Superalgos/TS/Bot-Modules/Trading-Bot/Announcements/SocialBots.js @@ -23,7 +23,7 @@ exports.newSuperalgosBotModulesSocialBots = function (processIndex) { } else if (socialBot.type === "Discord Bot") { let config = socialBot.config socialBot.botInstance = TS.projects.superalgos.botModules.discordBot.newSuperalgosBotModulesDiscordBot(processIndex) - socialBot.botInstance.initialize(config.webhookURL,config.format) + socialBot.botInstance.initialize(config) } } }