Evaluation formula for announcement

This commit is contained in:
Luis Fernando Molina committed 2019-10-21 09:24:01 +02:00
1 parent 28ccfdaa90
commit 50e20f38b7
1 file changed
+11
+11
View File
@@ -2691,6 +2691,17 @@
}
if (periods > lastPeriodAnnounced) {
let formulaValue
if (announcement.formula !== undefined) {
try {
formulaValue = eval(announcement.formula.code);
} catch (err) {
announcement.formula.error = err.message
}
}
announcement.formulaValue = formulaValue
bot.SESSION.socialBots.announce(announcement)
/* Next, we will remmeber this announcement was already done, so that it is not announced again in further processing of the same day. */