From 8ae324bcf47f3a816bd14bab7bcee016f15ff4b4 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Sun, 24 Jun 2018 21:10:52 +0200 Subject: [PATCH] Remember and Remind functions --- Assistant.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/Assistant.js b/Assistant.js index a470b691d..ff8c41fc4 100644 --- a/Assistant.js +++ b/Assistant.js @@ -22,7 +22,9 @@ getProfits: getProfits, getMarketRate: getMarketRate, getTicker: getTicker, - sendMessage: sendMessage + sendMessage: sendMessage, + rememberThis: rememberThis, + remindMeOf: remindMeOf }; let utilities = UTILITIES.newCloudUtilities(bot, logger); @@ -1236,4 +1238,28 @@ context.newHistoryRecord.messageBody = pBody; } + + function rememberThis(pKey, pValue) { + + if (context.executionContext.remember === undefined) { + + context.executionContext.remember = {}; + + } + + context.executionContext.remember[pKey] = pValue; + + } + + function remindMeOf(pKey) { + + if (context.executionContext.remember === undefined) { + + context.executionContext.remember = {}; + + } + + return context.executionContext.remember[pKey]; + + } }; \ No newline at end of file