Modules (JavaScript)

Supercharge your bots with our ready-to-use, prebuilt libraries! Whether you're handling data, making HTTP requests, or adding advanced logic, our libraries are designed to make bot development faster, easier, and a lot more fun.

🔧 Why Use Our Libraries?

  • Plug & Play: Just import and go — no boilerplate required.
  • Battle-Tested: Built with performance, stability, and real-world needs in mind.
  • Developer-Friendly: Clean APIs, helpful utilities, and consistent patterns.

✨ What’s Included?

  • HTTP: Simplify external API calls with elegant methods like .get(), .post(), and more.
  • Storage: Lightweight key-value data storage per bot or user instance.
  • More Coming Soon: We're constantly adding new tools to help you build smarter, faster, and cleaner bots.

Whether you're creating a support assistant, game bot, or custom automation — our libraries let you focus on logic, not low-level plumbing.

HTTP Module

The HTTP class provides a simplified interface for making HTTPS requests in Node.js. It supports common HTTP methods such as GET, POST, PUT, DELETE, HEAD, and OPTIONS. Each method returns a promise that resolves with the response body and headers.

All responses follow a unified format with the following structure:


Usage Examples

1. get(url, headers = {})

Sends a GET request to the given URL.


2. post(url, body, headers = {})

Sends a POST request. The body can be a raw string or an object (automatically stringified).


3. put(url, body, headers = {})

Sends a PUT request with a string or object as the request body.


4. delete(url, headers = {})

Sends a DELETE request.


5. head(url, headers = {})

Sends a HEAD request. Only headers will be returned, body will be null.


6. options(url, headers = {})

Sends an OPTIONS request to determine available HTTP methods and server capabilities.


Notes

  • Automatically stringifies objects for POST and PUT requests.
  • Handles request errors gracefully and returns an error field in the result if any issue occurs.
  • Does not throw; always resolves the promise to avoid unhandled rejections.

Certainly! Here's the revised Markdown documentation with:

  • A note that both key and value must be strings.
  • An explicit mention that there may be a limit on the number of entries based on the user's plan.

Storage Module (DataBase)

The Storage class provides a structured interface for storing key-value pairs scoped to a specific entity (e.g., a bot, user, or session). It supports reading, writing, and removing individual or all values in a persistent, queryable format.

⚠️ Important:

  • Both key and value must be strings.
  • The total number of stored properties may be limited by your plan quota. Exceeding this limit may prevent new entries from being saved.

Methods

1. get(key)

Retrieves the value for a given key.

Parameters:

  • key (string): The key to look up.

Returns:

  • string | undefined: The value, or undefined if the key does not exist.

Example:


2. exists(key)

Checks if a specific key exists.

Parameters:

  • key (string): The key to check.

Returns:

  • boolean: true if the key exists, false otherwise.

Example:


3. set(key, value)

Creates or updates a key-value pair.

Parameters:

  • key (string): The key to store.
  • value (string): The value to associate with the key.

Returns:

  • true: Indicates success.

Example:

⚠️ Note:

  • Both key and value must be strings.
  • The total number of stored properties may be capped based on your subscription plan.

4. delete(key)

Removes a key-value pair.

Parameters:

  • key (string): The key to delete.

Returns:

  • true: Indicates success.

Example:


5. clear()

Removes all key-value pairs.

Returns:

  • true: Indicates success.

Example:


6. getAll()

Returns all key-value pairs.

Returns:

  • Array<{ key: string, value: string, createdAt: number, updatedAt: number }>: A deep copy of all stored properties.

Example:


Best Practices

  • Always validate that key and value are strings before calling set().
  • Use exists() before using get() when unsure if a key is present.
  • Avoid storing sensitive or large payloads; storage is intended for lightweight configurations.
  • Monitor your usage if on a limited plan.

Example Usage

The Storage class is a robust utility for managing scoped, string-based key-value pairs. It is subject to platform-level limits and should be used according to plan allowances.