stoat-for-desktop/stoat.js
Ryan Fong 54549f47e1 Migrate to Tuari 2026-02-26 19:45:09 -08:00
..
.github/workflows Migrate to Tuari 2026-02-26 19:45:09 -08:00
.vscode Migrate to Tuari 2026-02-26 19:45:09 -08:00
src Migrate to Tuari 2026-02-26 19:45:09 -08:00
.gitignore Migrate to Tuari 2026-02-26 19:45:09 -08:00
.prettierrc Migrate to Tuari 2026-02-26 19:45:09 -08:00
LICENSE Migrate to Tuari 2026-02-26 19:45:09 -08:00
README.md Migrate to Tuari 2026-02-26 19:45:09 -08:00
default.nix Migrate to Tuari 2026-02-26 19:45:09 -08:00
eslint.config.js Migrate to Tuari 2026-02-26 19:45:09 -08:00
package.json Migrate to Tuari 2026-02-26 19:45:09 -08:00
pnpm-lock.yaml Migrate to Tuari 2026-02-26 19:45:09 -08:00
test.mjs Migrate to Tuari 2026-02-26 19:45:09 -08:00
tsconfig.json Migrate to Tuari 2026-02-26 19:45:09 -08:00

README.md

stoat.js

stoat.js stoat-api

stoat.js is a JavaScript library for interacting with the Stoat API

Requirements

To use this module, you must be using at least:

  • Node.js v22.15.0 (LTS) in ES module mode
  • or Deno v2.2 (LTS)

Example Usage

import { Client } from "stoat.js";

let client = new Client();

client.on("ready", async () =>
  console.info(`Logged in as ${client.user.username}!`),
);

client.on("messageCreate", async (message) => {
  if (message.content === "hello") {
    message.channel.sendMessage("world");
  }
});

client.loginBot("..");

Reactivity with Signals & Solid.js Primitives

All objects have reactivity built-in and can be dropped straight into any Solid.js project.

const client = new Client();
// initialise the client

function MyApp() {
  return (
    <h1>Your username is: {client.user?.username ?? "[logging in...]"}</h1>
  );
}

Stoat API Types

[!WARNING] It is advised you do not use this unless necessary. If you find somewhere that isn't covered by the library, please open an issue as this library aims to transform all objects.

All stoat-api types are re-exported from this library under API.

import { API } from "stoat.js";

// API.Channel;
// API.[..];