pass in config
This commit is contained in:
1 parent
c1da48bff8
commit
5303f0672c
2 files changed
+5
-5
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user