Skip to main content

Debug

Debugging with MooMoo.js

The Debug event in MooMoo.js allows developers to easily debug their scripts by providing a way to log debug messages. When the client receives a debug message from the MooMoo.js API, the Debug event is triggered and the message is passed as an argument to the callback function.

To use the Debug event, simply define a callback function and pass it to the on method of the MooMoo object, like so:

MooMoo.on("debug", (message) => {
console.debug(message);
});

The message argument will contain the debug message, which you can then log to the console using the console.debug method. This is a useful tool for checking for errors or verifying that your script is functioning as intended.