No description
  • TypeScript 100%
Find a file
2026-02-01 17:41:28 +03:00
.github/workflows Revert to an older version 2026-02-01 17:41:28 +03:00
.vscode first commit 2026-02-01 16:26:18 +03:00
.yarn/releases Revert to an older version 2026-02-01 17:41:28 +03:00
src Revert to an older version 2026-02-01 17:41:28 +03:00
.env.example Revert to an older version 2026-02-01 17:41:28 +03:00
.gitignore Revert to an older version 2026-02-01 17:41:28 +03:00
.prettierrc.js Revert to an older version 2026-02-01 17:41:28 +03:00
.yarnrc.yml Revert to an older version 2026-02-01 17:41:28 +03:00
LICENSE Revert to an older version 2026-02-01 17:41:28 +03:00
package.json Revert to an older version 2026-02-01 17:41:28 +03:00
README.md Revert to an older version 2026-02-01 17:41:28 +03:00
tsconfig.base.json Revert to an older version 2026-02-01 17:41:28 +03:00
tsconfig.cjs.json Revert to an older version 2026-02-01 17:41:28 +03:00
tsconfig.json Revert to an older version 2026-02-01 17:41:28 +03:00
yarn.lock Revert to an older version 2026-02-01 17:41:28 +03:00

revolt.js

revolt.js revolt-api

revolt.js is a direct implementation of the entire Revolt API and provides a way to authenticate and start communicating with Revolt servers.

Example Usage (Javascript / ES6)

import { Client } from "revolt.js";

let client = new Client();

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

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

client.loginBot("..");

If you are using Node, you must specify --experimental-specifier-resolution=node.

For example, node --experimental-specifier-resolution=node index.js.

Example Usage (CommonJS)

const { Client } = require("revolt.js");

let client = new Client();

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

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

client.loginBot("..");

Example Usage (Typescript)

import { Client } from "revolt.js";

let client = new Client();

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

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

client.loginBot("..");

MobX

MobX is used behind the scenes so you can subscribe to any change as you normally would, e.g. with mobx-react(-lite) or mobx's utility functions.

import { autorun } from 'mobx';

[..]

client.once('ready', () => {
    autorun(() => {
        console.log(`Current username is ${client.user!.username}!`);
    });
});

Revolt API Types

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

import { API } from 'revolt.js';

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