I had an issue while developing a bot locally which caused duplicate commands along with my console window flooded with errors about how there was no result to parse in the setInterval. (I was on a weak wifi signal and this caused almost half my packets to be dropped)
Investigating further, I realised that any HTTP.get errors would only call a console.log with the exception, but parsePollResult will still be called.
I added a quick check if(result) before calling parsePollResult and it fixed all my above issues.
EDIT: Also added 2 more checks which prevent calling parsePollResult if there are no updates, and to check if there was duplicate poll data
Also took the chance to format the readme and add missing semicolons.
I had an issue while developing a bot locally which caused duplicate commands along with my console window flooded with errors about how there was no result to parse in the
setInterval
. (I was on a weak wifi signal and this caused almost half my packets to be dropped)Investigating further, I realised that any
HTTP.get
errors would only call aconsole.log
with the exception, butparsePollResult
will still be called.I added a quick check
if(result)
before calling parsePollResult and it fixed all my above issues.EDIT: Also added 2 more checks which prevent calling parsePollResult if there are no updates, and to check if there was duplicate poll data
Also took the chance to format the readme and add missing semicolons.