all are optional, whatever the plugins wants to subscribe to
for the messageEventHandler array of asyncFuncs, each async Func must contains three functions defined inside of handlerFunction
these three functions would be used by alert bot to handle events internally, this is based on the concept of Closures in javascript
plugins can be categorized into 2 types
event subscribers (always listening for events but triggers only when an event occurs)
plugins that just require the whatsapp env to interact but don't care about events (like updates)
tell them to specify a time for a setInterval and then run each of these on a separate thread process for improvements in performance
[HYBRID] plugins that require a cron job but also need to subscribe to an events, i can't think of any examples right now, but it should be simple, if the plugin specifies that it needs to be hybrid, just put it's main function in the plugin and the setInterval
the problem arises when the plugins wants to remember that whether it was called by some event before running the cron job, since those both are unrelated in the actual implementation, it would be considered the job of the plugin to make a lock file of sorts for itself and manage it itself, for that we provide and recommend reliableDb and can also provide a method to just make a lock file in future with a unique ID, though that's far fetched, plugins currently would be expected to handle context problems like these by themselves.
@ota0912 have a look and add/remove stuff
also review should an object be passed as i wrote or something similar to closures as i've wrote in handleMessage