npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

highrise.sdk.dev

v2.4.0

Published

A JavaScript library for writing and running Highrise bots.

Downloads

148

Readme

highrise.sdk.dev

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

IMPORTANT

This package is still in beta and is not yet ready for production use. Please use it with caution and report any issues or bugs you encounter.

⚙️ Installation

npm i highrise.sdk.dev@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, Events, WebApi } = require('highrise.sdk.dev');
  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
};
  1. Create an instance of the Highrise bot, specifying the desired intents and cache option:
// Create a new instance of the Highrise bot
const bot = new Highrise({
  Events: [
    Events.Joins, // Listen for user joins
    Events.Leaves, // Listen for user leaves
    Events.Messages // Listen for chat messages
    // Add more events here
  ],
  Cache: true, // Enable caching
  AutoFetchMessages: true // If you want to capture the incoming message in the messageCreate event.
});
  1. Logging in the bot:
bot.login(settings.token, settings.room); // Log in the bot

🎋 Events

Events 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:

  • Events.Messages: Represents chat messages sent in the Highrise room.
  • Events.DirectMessages: Represents direct messages sent to the bot.
  • Events.Joins: Indicates when users join the room.
  • Events.Leaves: Indicates when users leave the room.
  • Events.Reactions: Represents reactions added to players.
  • Events.Emotes: Represents emotes added to players.
  • Events.Tips: Represents tip reactions received.
  • Events.VoiceChat: Represents voice chat events.
  • Events.Movements: Indicates when users move within the room.
  • Events.Error: Represents errors that occur during API operations.
  • Events.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) => {
  console.log("[i]".green + ` Bot is ready!`.green);
});
  • Listening for chat messages:
bot.on('chatCreate', async (user, message) => {
  console.log("[i]".green + ` ${user.username} sent a message: ${message}`.green);
});
  • Listening for Direct Messages:
// if AutoFetchMessages is set to true in the bot options you can capture the incoming message, otherwise you will need to fetch the message manually.
bot.on("messageCreate", async (user, data, message) => {
  console.log("[i]".green + ` ${user} sent a message: ${message}`.green);
});
  • Listening for the join event:
bot.on('playerJoin', (user, position) => {
  console.log("[i]".green + ` ${user.username} joined the room.`.green);
})

📘 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.