JavaScript SDK 1.1.6 released!
Hello JavaScript users, we have updated the package to include a few additional methods.
- Introducing a new event that emits after performing moderation actions [“kick”, “ban”, “unban”, “mute”, “unmute”].
- Implementation of a new Gateway for the “Moderate” event.
- Addition of a new method that enables you to shut down the bot
bot.shutdown()
- Addressed issues with WebApi, where it would occasionally return an error when no results were found. It has been enhanced to now return “null” in such cases.
To get started, please follow these steps:
- Run the command:
$ npm uninstall highrise.sdk
- Run the command:
$ npm install highrise.sdk@latest
Usage:
// Import the required modules from the Highrise SDK
const { Highrise, GatewayIntentBits } = require('../highrise.sdk');
// Create a new instance of the Highrise class for your bot
const bot = new Highrise({
intents: [
GatewayIntentBits.Ready, // Listen for the "Ready" event
GatewayIntentBits.Messages, // Listen for message events
GatewayIntentBits.Moderate // Listen for moderation-related events
],
});
// Register an event listener for the "roomModerate" event
bot.on("roomModerate", (moderatorId, targetUserId, moderationAction, duration) => {
// Log the moderation action details
console.log(`${moderatorId} performed ${moderationAction} on ${targetUserId} for ${duration}`);
});
click here to learn more about the new changes.