lalo 4f4b153360 refactor: message.content always returns a string (#72)
Not to sure but this could be a simple fix for system messages having "no message content".

Everytime someone uses the `client.on("message",...)` function they have to include a check if `message.content` even exists when wanting to work with `message.content` since if you don't the program breaks every time it recieves a system message, which returns a message with undefined content. In my opinion making `message.content` always return a string is a better alternative to undefined. It would make using revolt.js more convenient for most of the developers.
2023-08-25 15:50:22 +01:00
2023-04-08 10:57:11 +01:00
2023-04-07 09:58:47 +01:00
2023-04-07 09:58:47 +01:00
2023-08-25 15:48:28 +01:00
2023-04-14 20:04:38 +01:00
2023-04-09 14:17:52 +01:00

revolt.js

Warning

revolt.js is currently being rewritten, it's pretty much ready for use for most applications but is still not entirely feature complete.

You can find the version 6 README here.

revolt.js revolt-api

revolt.js is a JavaScript library for interacting with the entire Revolt API.

Example Usage

// esm / typescript
import { Client } from "revolt.js";
// ...or commonjs
const { Client } = require("revolt.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>
  );
}

Revolt API Types

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

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.

import { API } from "revolt.js";

// API.Channel;
// API.[..];
S
Description
Typescript library for interacting with Stoat
Readme MIT 12 MiB
Latest
2026-01-16 13:28:35 -05:00
Languages
TypeScript 99.4%
JavaScript 0.5%