The file weather.js has been thoroughly refactored. It mostly does the same as before, except that it now makes use of the memory API.
Alongside this, there are also a couple of new functions in util:
evalTextStart takes a callback function and as many strings as you want. If the text starts with any of the strings, it returns de callback, otherwise it moves down the pipeline.
checkClearance takes a callback and the message. It uses checkRole but instead of returning a boolean, it calls the callback if true and returns a text indicating the need for another role if false.
roll has been updated to make use of the new function checkClearance instead of checkRole.
The file
weather.js
has been thoroughly refactored. It mostly does the same as before, except that it now makes use of the memory API.Alongside this, there are also a couple of new functions in
util
:evalTextStart
takes a callback function and as many strings as you want. If the text starts with any of the strings, it returns de callback, otherwise it moves down the pipeline.checkClearance
takes a callback and the message. It usescheckRole
but instead of returning a boolean, it calls the callback iftrue
and returns a text indicating the need for another role iffalse
.roll
has been updated to make use of the new functioncheckClearance
instead ofcheckRole
.