global.processDatetime
This commit is contained in:
1 parent
1d00aaf6d2
commit
bbcc247255
7 files changed
+123
-50
No files matched your search
Binary file not shown.
+2
-4
@@ -26,7 +26,6 @@
|
|||||||
let openPositions = []; // These are the open positions the bot knows it made by itself.
|
let openPositions = []; // These are the open positions the bot knows it made by itself.
|
||||||
|
|
||||||
let botContext;
|
let botContext;
|
||||||
let processDatetime;
|
|
||||||
let exchangeAPI;
|
let exchangeAPI;
|
||||||
|
|
||||||
return thisObject;
|
return thisObject;
|
||||||
@@ -40,7 +39,6 @@
|
|||||||
/* Store local values. */
|
/* Store local values. */
|
||||||
|
|
||||||
botContext = pBotContext;
|
botContext = pBotContext;
|
||||||
processDatetime = pProcessDatetime;
|
|
||||||
exchangeAPI = pExchangeAPI;
|
exchangeAPI = pExchangeAPI;
|
||||||
|
|
||||||
getPositionsAtExchange(onDone);
|
getPositionsAtExchange(onDone);
|
||||||
@@ -439,7 +437,7 @@
|
|||||||
rate: pRate,
|
rate: pRate,
|
||||||
amountA: pAmountA,
|
amountA: pAmountA,
|
||||||
amountB: pAmountB,
|
amountB: pAmountB,
|
||||||
date: (processDatetime.valueOf()),
|
date: (global.processDatetime.valueOf()),
|
||||||
status: "open",
|
status: "open",
|
||||||
trades: []
|
trades: []
|
||||||
};
|
};
|
||||||
@@ -501,7 +499,7 @@
|
|||||||
rate: pNewRate,
|
rate: pNewRate,
|
||||||
amountA: pPosition.amountB * pNewRate,
|
amountA: pPosition.amountB * pNewRate,
|
||||||
amountB: pPosition.amountB,
|
amountB: pPosition.amountB,
|
||||||
date: (processDatetime.valueOf()),
|
date: (global.processDatetime.valueOf()),
|
||||||
status: "open",
|
status: "open",
|
||||||
trades: []
|
trades: []
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ exports.newAzureFileStorage = function newAzureFileStorage(BOT) {
|
|||||||
dataOwner = pDataOwnerBotCodeName;
|
dataOwner = pDataOwnerBotCodeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.fileName = MODULE_NAME + '.' + dataOwner;
|
||||||
|
|
||||||
readConnectionStringConfigFile(onConnectionStringReady);
|
readConnectionStringConfigFile(onConnectionStringReady);
|
||||||
|
|
||||||
function onConnectionStringReady(err, pConnObj) {
|
function onConnectionStringReady(err, pConnObj) {
|
||||||
|
|||||||
+4
-7
@@ -64,11 +64,9 @@
|
|||||||
|
|
||||||
let cloudStorage = FILE_STORAGE.newAzureFileStorage(bot);
|
let cloudStorage = FILE_STORAGE.newAzureFileStorage(bot);
|
||||||
|
|
||||||
let processDatetime;
|
|
||||||
|
|
||||||
return thisObject;
|
return thisObject;
|
||||||
|
|
||||||
function initialize(pProcessDatetime, callBackFunction) {
|
function initialize(callBackFunction) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -90,8 +88,7 @@
|
|||||||
|
|
||||||
if (err.result === global.DEFAULT_OK_RESPONSE.result) {
|
if (err.result === global.DEFAULT_OK_RESPONSE.result) {
|
||||||
|
|
||||||
thisObject.newHistoryRecord.date = pProcessDatetime;
|
thisObject.newHistoryRecord.date = global.processDatetime;
|
||||||
processDatetime = pProcessDatetime;
|
|
||||||
|
|
||||||
getStatusReport(onDone);
|
getStatusReport(onDone);
|
||||||
|
|
||||||
@@ -372,7 +369,7 @@
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
let fileName = "Execution.Context.json"
|
let fileName = "Execution.Context.json"
|
||||||
let dateForPath = processDatetime.getUTCFullYear() + '/' + utilities.pad(processDatetime.getUTCMonth() + 1, 2) + '/' + utilities.pad(processDatetime.getUTCDate(), 2) + '/' + utilities.pad(processDatetime.getUTCHours(), 2) + '/' + utilities.pad(processDatetime.getUTCMinutes(), 2);
|
let dateForPath = global.processDatetime.getUTCFullYear() + '/' + utilities.pad(global.processDatetime.getUTCMonth() + 1, 2) + '/' + utilities.pad(global.processDatetime.getUTCDate(), 2) + '/' + utilities.pad(global.processDatetime.getUTCHours(), 2) + '/' + utilities.pad(global.processDatetime.getUTCMinutes(), 2);
|
||||||
let filePath = bot.devTeam + "/" + bot.codeName + "/" + bot.version + "/" + bot.dataSetVersion + "/Output/" + bot.process + "/" + global.EXCHANGE_NAME + "/" + dateForPath;
|
let filePath = bot.devTeam + "/" + bot.codeName + "/" + bot.version + "/" + bot.dataSetVersion + "/Output/" + bot.process + "/" + global.EXCHANGE_NAME + "/" + dateForPath;
|
||||||
|
|
||||||
utilities.createFolderIfNeeded(filePath, cloudStorage, onFolderCreated);
|
utilities.createFolderIfNeeded(filePath, cloudStorage, onFolderCreated);
|
||||||
@@ -507,7 +504,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
thisObject.statusReport.lastExecution = processDatetime;
|
thisObject.statusReport.lastExecution = global.processDatetime;
|
||||||
|
|
||||||
let fileContent = JSON.stringify(thisObject.statusReport);
|
let fileContent = JSON.stringify(thisObject.statusReport);
|
||||||
|
|
||||||
|
|||||||
+95
-25
@@ -140,7 +140,9 @@
|
|||||||
function getMarketFiles() {
|
function getMarketFiles() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
/* Now we will get the market files */
|
|
||||||
|
let filesOk = 0;
|
||||||
|
let filesNotOk = 0;
|
||||||
|
|
||||||
for (i = 0; i < marketFilesPeriods.length; i++) {
|
for (i = 0; i < marketFilesPeriods.length; i++) {
|
||||||
|
|
||||||
@@ -149,14 +151,27 @@
|
|||||||
|
|
||||||
getFile(oliviaAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Output/Candles/Multi-Period-Market/@Period", periodName, undefined, onFileReceived, callBack);
|
getFile(oliviaAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Output/Candles/Multi-Period-Market/@Period", periodName, undefined, onFileReceived, callBack);
|
||||||
|
|
||||||
function onFileReceived(file) {
|
function onFileReceived(err, file) {
|
||||||
|
|
||||||
thisObject.candlesFiles.set(periodName, file);
|
if (err.result === global.DEFAULT_OK_RESPONSE.result) {
|
||||||
|
filesOk++;
|
||||||
|
thisObject.candlesFiles.set(periodName, file);
|
||||||
|
} else {
|
||||||
|
filesNotOk++;
|
||||||
|
}
|
||||||
|
|
||||||
if (thisObject.candlesFiles.size === marketFilesPeriods.length) {
|
if (filesOk + filesNotOk === marketFilesPeriods.length) {
|
||||||
|
|
||||||
getDailyFiles();
|
if (filesOk === marketFilesPeriods.length) {
|
||||||
|
|
||||||
|
getDailyFiles();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
logger.write("[ERROR] getCandles -> getMarketFiles -> onFileReceived -> Some files are missing -> filesNotOk = " + filesNotOk);
|
||||||
|
logger.write("[ERROR] getCandles -> getMarketFiles -> onFileReceived -> Will abort the process and request a retry.");
|
||||||
|
callBack(global.DEFAULT_RETRY_RESPONSE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -169,21 +184,38 @@
|
|||||||
function getDailyFiles() {
|
function getDailyFiles() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
let filesOk = 0;
|
||||||
|
let filesNotOk = 0;
|
||||||
|
|
||||||
for (i = 0; i < dailyFilePeriods.length; i++) {
|
for (i = 0; i < dailyFilePeriods.length; i++) {
|
||||||
|
|
||||||
let periodTime = dailyFilePeriods[i][0];
|
let periodTime = dailyFilePeriods[i][0];
|
||||||
let periodName = dailyFilePeriods[i][1];
|
let periodName = dailyFilePeriods[i][1];
|
||||||
|
|
||||||
getFile(oliviaAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Output/Candles/Multi-Period-Daily/@Period/@Year/@Month/@Day", periodName, processDatetime, onFileReceived, callBack);
|
getFile(oliviaAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Output/Candles/Multi-Period-Daily/@Period/@Year/@Month/@Day", periodName, global.processDatetime, onFileReceived, callBack);
|
||||||
|
|
||||||
function onFileReceived(file) {
|
function onFileReceived(err, file) {
|
||||||
|
|
||||||
thisObject.candlesFiles.set(periodName, file);
|
if (err.result === global.DEFAULT_OK_RESPONSE.result) {
|
||||||
|
filesOk++;
|
||||||
|
thisObject.candlesFiles.set(periodName, file);
|
||||||
|
} else {
|
||||||
|
filesNotOk++;
|
||||||
|
}
|
||||||
|
|
||||||
if (thisObject.candlesFiles.size === dailyFilePeriods.length + marketFilesPeriods.length) {
|
if (filesOk + filesNotOk === dailyFilePeriods.length) {
|
||||||
|
|
||||||
getCandlesWeAreIn();
|
if (filesOk === dailyFilePeriods.length) {
|
||||||
|
|
||||||
|
getCandlesWeAreIn();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
logger.write("[ERROR] getCandles -> getDailyFiles -> onFileReceived -> Some files are missing -> filesNotOk = " + filesNotOk);
|
||||||
|
logger.write("[ERROR] getCandles -> getDailyFiles -> onFileReceived -> Will abort the process and request a retry.");
|
||||||
|
callBack(global.DEFAULT_RETRY_RESPONSE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -233,7 +265,7 @@
|
|||||||
|
|
||||||
let timePeriod = candle.end - candle.begin + 1; // In miliseconds. (remember each candle spans a period minus one milisecond)
|
let timePeriod = candle.end - candle.begin + 1; // In miliseconds. (remember each candle spans a period minus one milisecond)
|
||||||
|
|
||||||
if (candle.begin >= processDatetime.valueOf() - timePeriod * 10 && candle.end <= processDatetime.valueOf()) {
|
if (candle.begin >= global.processDatetime.valueOf() - timePeriod * 10 && candle.end <= global.processDatetime.valueOf()) {
|
||||||
|
|
||||||
candlesArray.push(candle);
|
candlesArray.push(candle);
|
||||||
|
|
||||||
@@ -277,7 +309,9 @@
|
|||||||
function getMarketFiles() {
|
function getMarketFiles() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
/* Now we will get the market files */
|
|
||||||
|
let filesOk = 0;
|
||||||
|
let filesNotOk = 0;
|
||||||
|
|
||||||
for (i = 0; i < marketFilesPeriods.length; i++) {
|
for (i = 0; i < marketFilesPeriods.length; i++) {
|
||||||
|
|
||||||
@@ -286,14 +320,27 @@
|
|||||||
|
|
||||||
getFile(tomAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Tom/dataSet.V1/Output/Candle-Stairs/Multi-Period-Market/@Period", periodName, undefined, onFileReceived, callBack);
|
getFile(tomAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Tom/dataSet.V1/Output/Candle-Stairs/Multi-Period-Market/@Period", periodName, undefined, onFileReceived, callBack);
|
||||||
|
|
||||||
function onFileReceived(file) {
|
function onFileReceived(err, file) {
|
||||||
|
|
||||||
thisObject.stairsFiles.set(periodName, file);
|
if (err.result === global.DEFAULT_OK_RESPONSE.result) {
|
||||||
|
filesOk++;
|
||||||
|
thisObject.stairsFiles.set(periodName, file);
|
||||||
|
} else {
|
||||||
|
filesNotOk++;
|
||||||
|
}
|
||||||
|
|
||||||
if (thisObject.stairsFiles.size === marketFilesPeriods.length) {
|
if (filesOk + filesNotOk === marketFilesPeriods.length) {
|
||||||
|
|
||||||
getDailyFiles();
|
if (filesOk === marketFilesPeriods.length) {
|
||||||
|
|
||||||
|
getDailyFiles();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
logger.write("[ERROR] getPatterns -> getMarketFiles -> onFileReceived -> Some files are missing -> filesNotOk = " + filesNotOk);
|
||||||
|
logger.write("[ERROR] getPatterns -> getMarketFiles -> onFileReceived -> Will abort the process and request a retry.");
|
||||||
|
callBack(global.DEFAULT_RETRY_RESPONSE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -306,21 +353,38 @@
|
|||||||
function getDailyFiles() {
|
function getDailyFiles() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
let filesOk = 0;
|
||||||
|
let filesNotOk = 0;
|
||||||
|
|
||||||
for (i = 0; i < dailyFilePeriods.length; i++) {
|
for (i = 0; i < dailyFilePeriods.length; i++) {
|
||||||
|
|
||||||
let periodTime = dailyFilePeriods[i][0];
|
let periodTime = dailyFilePeriods[i][0];
|
||||||
let periodName = dailyFilePeriods[i][1];
|
let periodName = dailyFilePeriods[i][1];
|
||||||
|
|
||||||
getFile(tomAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Tom/dataSet.V1/Output/Candle-Stairs/Multi-Period-Daily/@Period/@Year/@Month/@Day", periodName, processDatetime, onFileReceived, callBack);
|
getFile(tomAzureFileStorage, "@AssetA_@AssetB.json", "@Exchange/Tom/dataSet.V1/Output/Candle-Stairs/Multi-Period-Daily/@Period/@Year/@Month/@Day", periodName, global.processDatetime, onFileReceived, callBack);
|
||||||
|
|
||||||
function onFileReceived(file) {
|
function onFileReceived(err, file) {
|
||||||
|
|
||||||
thisObject.stairsFiles.set(periodName, file);
|
if (err.result === global.DEFAULT_OK_RESPONSE.result) {
|
||||||
|
filesOk++;
|
||||||
|
thisObject.stairsFiles.set(periodName, file);
|
||||||
|
} else {
|
||||||
|
filesNotOk++;
|
||||||
|
}
|
||||||
|
|
||||||
if (thisObject.stairsFiles.size === dailyFilePeriods.length + marketFilesPeriods.length) {
|
if (filesOk + filesNotOk === dailyFilePeriods.length) {
|
||||||
|
|
||||||
getStairsWeAreIn();
|
if (filesOk === dailyFilePeriods.length) {
|
||||||
|
|
||||||
|
getStairsWeAreIn();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
logger.write("[ERROR] getPatterns -> getDailyFiles -> onFileReceived -> Some files are missing -> filesNotOk = " + filesNotOk);
|
||||||
|
logger.write("[ERROR] getPatterns -> getDailyFiles -> onFileReceived -> Will abort the process and request a retry.");
|
||||||
|
callBack(global.DEFAULT_RETRY_RESPONSE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -374,7 +438,7 @@
|
|||||||
stairs.lastMin = pStairsFile[i][10];
|
stairs.lastMin = pStairsFile[i][10];
|
||||||
stairs.lastMax = pStairsFile[i][11];
|
stairs.lastMax = pStairsFile[i][11];
|
||||||
|
|
||||||
if (processDatetime.valueOf() >= stairs.begin && processDatetime.valueOf() <= stairs.end) {
|
if (global.processDatetime.valueOf() >= stairs.begin && global.processDatetime.valueOf() <= stairs.end) {
|
||||||
|
|
||||||
thisObject.stairsMap.set(pPeriodName, stairs);
|
thisObject.stairsMap.set(pPeriodName, stairs);
|
||||||
|
|
||||||
@@ -424,24 +488,30 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FULL_LOG === true) { logger.write("[INFO] initialize -> getFile -> final pFilePath = " + pFilePath); }
|
||||||
|
if (FULL_LOG === true) { logger.write("[INFO] initialize -> getFile -> final pFileName = " + pFileName); }
|
||||||
|
|
||||||
pFileStorage.getTextFile(pFilePath, pFileName, onFileReceived);
|
pFileStorage.getTextFile(pFilePath, pFileName, onFileReceived);
|
||||||
|
|
||||||
function onFileReceived(err, text) {
|
function onFileReceived(err, text) {
|
||||||
|
|
||||||
|
if (FULL_LOG === true) { logger.write("[INFO] initialize -> getFile -> onFileReceived -> pFilePath = " + pFilePath); }
|
||||||
|
if (FULL_LOG === true) { logger.write("[INFO] initialize -> getFile -> onFileReceived -> pFileName = " + pFileName); }
|
||||||
|
|
||||||
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
|
if (err.result !== global.DEFAULT_OK_RESPONSE.result) {
|
||||||
logger.write("[ERROR] initialize -> getFile -> onFileReceived -> err = " + err.message);
|
logger.write("[ERROR] initialize -> getFile -> onFileReceived -> err = " + err.message);
|
||||||
outerCallBack(err);
|
innerCallBack(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
let data = JSON.parse(text);
|
let data = JSON.parse(text);
|
||||||
innerCallBack(data);
|
innerCallBack(global.DEFAULT_OK_RESPONSE, data);
|
||||||
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.write("[ERROR] initialize -> getFile -> onFileReceived -> Parsing JSON -> err = " + err.message);
|
logger.write("[ERROR] initialize -> getFile -> onFileReceived -> Parsing JSON -> err = " + err.message);
|
||||||
outerCallBack(err);
|
innerCallBack(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ const FULL_LOG = true;
|
|||||||
|
|
||||||
/* The following global variable tells the system if it is running on test mode or production. */
|
/* The following global variable tells the system if it is running on test mode or production. */
|
||||||
|
|
||||||
global.RUNNING_MODE = 'Testnet'; // or 'Production'
|
global.RUNNING_MODE = 'Production'; // 'Testnet' or 'Production'
|
||||||
|
|
||||||
/* First thing to do is to read the config and guess which bot we will be running. */
|
/* First thing to do is to read the config and guess which bot we will be running. */
|
||||||
|
|
||||||
|
|||||||
+19
-13
@@ -3,7 +3,7 @@
|
|||||||
let bot = BOT;
|
let bot = BOT;
|
||||||
const ROOT_DIR = './';
|
const ROOT_DIR = './';
|
||||||
|
|
||||||
const MODULE_NAME = "Trading Bot";
|
const MODULE_NAME = "Trading Bot Main Loop";
|
||||||
const FULL_LOG = true;
|
const FULL_LOG = true;
|
||||||
|
|
||||||
let USER_BOT_MODULE;
|
let USER_BOT_MODULE;
|
||||||
@@ -63,8 +63,8 @@
|
|||||||
|
|
||||||
/* We define the datetime for the process that we are running now. This will be the official processing time for both the infraestructure and the bot. */
|
/* We define the datetime for the process that we are running now. This will be the official processing time for both the infraestructure and the bot. */
|
||||||
|
|
||||||
let processDatetime = new Date(); // This will be considered the process date and time, so as to have it consistenly all over the execution.
|
global.processDatetime = new Date(); // This will be considered the process date and time, so as to have it consistenly all over the execution.
|
||||||
processDatetime = new Date(processDatetime.valueOf() - 30 * 24 * 60 * 60 * 1000); // we go 30 days back in time since candles are currently not up to date.
|
global.processDatetime = new Date(global.processDatetime.valueOf() - 30 * 24 * 60 * 60 * 1000); // we go 30 days back in time since candles are currently not up to date.
|
||||||
|
|
||||||
/* We will prepare first the infraestructure needed for the bot to run. There are 3 modules we need to sucessfullly initialize first. */
|
/* We will prepare first the infraestructure needed for the bot to run. There are 3 modules we need to sucessfullly initialize first. */
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeContext -> Entering function."); }
|
if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeContext -> Entering function."); }
|
||||||
|
|
||||||
context = CONTEXT.newContext(bot, DEBUG_MODULE, AZURE_FILE_STORAGE);
|
context = CONTEXT.newContext(bot, DEBUG_MODULE, AZURE_FILE_STORAGE);
|
||||||
context.initialize(processDatetime, onInizialized);
|
context.initialize(onInizialized);
|
||||||
|
|
||||||
function onInizialized(err) {
|
function onInizialized(err) {
|
||||||
|
|
||||||
@@ -91,7 +91,13 @@
|
|||||||
initializeDatasource();
|
initializeDatasource();
|
||||||
} else {
|
} else {
|
||||||
logger.write("[ERROR] run -> loop -> initializeContext -> err = " + err.message);
|
logger.write("[ERROR] run -> loop -> initializeContext -> err = " + err.message);
|
||||||
callBackFunction(err);
|
if (err.result === global.DEFAULT_RETRY_RESPONSE.result) {
|
||||||
|
nextWaitTime = 'Retry';
|
||||||
|
loopControl(nextWaitTime);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
callBackFunction(err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -104,11 +110,12 @@
|
|||||||
datasource.initialize(onInizialized);
|
datasource.initialize(onInizialized);
|
||||||
|
|
||||||
function onInizialized(err) {
|
function onInizialized(err) {
|
||||||
|
logger.write("[ERROR] run -> loop -> initializeDatasource -> err = " + err.message);
|
||||||
if (err.result === global.DEFAULT_OK_RESPONSE.result) {
|
if (err.result === global.DEFAULT_RETRY_RESPONSE.result) {
|
||||||
initializeExchangeAPI();
|
nextWaitTime = 'Retry';
|
||||||
} else {
|
loopControl(nextWaitTime);
|
||||||
logger.write("[ERROR] run -> loop -> initializeDatasource -> err = " + err.message);
|
}
|
||||||
|
else {
|
||||||
callBackFunction(err);
|
callBackFunction(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -137,7 +144,7 @@
|
|||||||
if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeAssistant -> Entering function."); }
|
if (FULL_LOG === true) { logger.write("[INFO] run -> loop -> initializeAssistant -> Entering function."); }
|
||||||
|
|
||||||
assistant = ASSISTANT.newAssistant(bot, DEBUG_MODULE);
|
assistant = ASSISTANT.newAssistant(bot, DEBUG_MODULE);
|
||||||
assistant.initialize(processDatetime, context, exchangeAPI, onInizialized);
|
assistant.initialize(context, exchangeAPI, onInizialized);
|
||||||
|
|
||||||
function onInizialized(err) {
|
function onInizialized(err) {
|
||||||
|
|
||||||
@@ -159,8 +166,7 @@
|
|||||||
let platform = {
|
let platform = {
|
||||||
context: context,
|
context: context,
|
||||||
datasource: datasource,
|
datasource: datasource,
|
||||||
assistant: assistant,
|
assistant: assistant
|
||||||
processDatetime: processDatetime
|
|
||||||
};
|
};
|
||||||
|
|
||||||
usertBot.initialize(platform, onInizialized);
|
usertBot.initialize(platform, onInizialized);
|
||||||
|
|||||||
Reference in new issue
Block a user