This event triggers when a moderator takes action in the room. It comprises four parameters: the moderator ID, the target ID, the action type (which can be "mute," "kick," "ban," or "unban"), and optionally, the duration. Only "ban" and "mute" actions have durations, which are logged in seconds.
Note: This event does not log the usernames for the moderator or the target. Therefore, you'll need to implement your own method for obtaining this information. You can use methods to retrieve the username from the moderator ID and the username for the target using the WebAPI.
const { Highrise, Events } = require("highrise.sdk");
// Create a new instance of the Highrise class.
const bot = new Highrise({
Events: [
Events.Moderate // Listen for moderation events.
]
});
// Listen for roomModerate events.
bot.on("roomModerate", (moderator_id, target_id, action, duration) => {
// Log the moderation event to the console.
console.log(`[MODERATION]: ${moderator_id} - ${target_id} - ${action} - ${duration}`);
});
Go Back: Get Methods