1.1.7 • Published 7 months ago

highrise.sdk v1.1.7

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

highrise.sdk

The Highrise SDK is a JavaScript library for writing and running Highrise bots.

⚙️ Installation

npm i highrise.sdk@latest

✨ Features

  • Easy to use.
  • Beginner friendly.
  • Auto reconnect system.
  • Supports Node version 10+
  • Supports Highrise WebAPI

📥 Class Import

  1. Import the necessary classes and modules from the SDK:
const { Highrise, GatewayIntentBits, WebApi } = require('highrise.sdk');
  1. Set up the bot's settings by providing a bot token and room ID:
const settings = {
  token: 'CHANGE-ME', // Replace with your bot token
  room: 'CHANGE-ME', // Replace with the room ID your bot will join
  reconnect: 5 // Reconnect duration in seconds
};
  1. Create an instance of the Highrise bot, specifying the desired intents and cache option:
const bot = new Highrise({
  intents: [
    GatewayIntentBits.Ready,
    GatewayIntentBits.Messages,
    GatewayIntentBits.Joins,
    GatewayIntentBits.Leaves,
    GatewayIntentBits.Error
  ],
  cache: true
}, settings.reconnect);
  1. Logging in the bot:
bot.login(settings.token, settings.room);

🎋 GatewayIntentBits

GatewayIntentBits represents the different intents or event types that your bot can listen for. By specifying these intents when creating the bot, you can control which events your bot will receive. The available intents include:

  • GatewayIntentBits.Ready: Indicates when the bot is ready to start interacting.
  • GatewayIntentBits.Messages: Represents chat messages sent in the Highrise room.
  • GatewayIntentBits.DirectMessages: Represents direct messages sent to the bot.
  • GatewayIntentBits.Joins: Indicates when users join the room.
  • GatewayIntentBits.Leaves: Indicates when users leave the room.
  • GatewayIntentBits.Reactions: Represents reactions added to players.
  • GatewayIntentBits.Emotes: Represents emotes added to players.
  • GatewayIntentBits.Tips: Represents tip reactions received.
  • GatewayIntentBits.VoiceChat: Represents voice chat events.
  • GatewayIntentBits.Movements: Indicates when users move within the room.
  • GatewayIntentBits.Error: Represents errors that occur during API operations.
  • GatewayIntentBits.Moderate: Indicates when moderators perform moderation actions on players.

You can choose the intents based on the events you want your bot to handle.

📦 Cache Option

The cache option, when set to true, enables caching of certain data to optimize performance and reduce API calls. By enabling the cache and using the appropriate intents, you can utilize methods that rely on cached data rather than making API requests.

📖 Examples

  • Listening for the ready event:
bot.on('ready', (session) => {
  // Handle bot ready event
});
  • Listening for chat messages:
bot.on('chatCreate', async (user, message) => {
  // Handle chat message event
});
  • Listening for errors:
bot.on('error', (message) => {
  // Handle error event
});

📘 Documentation

Refer to the SDK documentation for more information on available events and methods. Highrise JS SDK Documentation

🤝 Contributions

Contributions to the Highrise SDK are welcome! If you find any issues or want to add new features, feel free to submit a pull request.

Note

This package is not an official Highrise package, it's self-made by iHsein (sphinix) and is still in beta.

1.1.7

7 months ago

1.1.6

9 months ago

1.1.5

9 months ago

1.1.4

10 months ago

1.1.3

10 months ago

1.1.2

10 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago