Skip to main content

XpEvents.on()

Callback events for different purposes! Each callback will disable console.log(), giving you full control over the output.

info

For the best result, use this before any other functions, including connect().

Parameters

ParameterTypeRequiredDescription
XpEventCallbackXpEventCallbackThe callback to run when the event is emitted.

Examples

const {XpEvents} = require("simply-xp");

XpEvents.on({
debug: (xpFunction, message) => {
// Handle debug event
},
error: (xpFunction, message) => {
// Handle error event
},
info: (xpFunction, message) => {
// Handle info event
},
levelDown: (data, lostRoles) => {
// Handle levelDown event
},
levelUp: (data, newRoles) => {
// Handle levelUp event
},
warn: (xpFunction, message) => {
// Handle warn event
}
});