All Projects → revoltchat → revolt.js

revoltchat / revolt.js

Licence: MIT license
Modern Typescript library for interacting with Revolt.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to revolt.js

january
Image proxy and embed generator.
Stars: ✭ 24 (-82.98%)
Mutual labels:  revolt
rvmob
(Community-led Project) React Native Revolt client.
Stars: ✭ 39 (-72.34%)
Mutual labels:  revolt
revite
Revolt client built with Preact.
Stars: ✭ 606 (+329.79%)
Mutual labels:  revolt
documentation
Revolt documentation website.
Stars: ✭ 20 (-85.82%)
Mutual labels:  revolt
translations
i18n translations of Revolt
Stars: ✭ 27 (-80.85%)
Mutual labels:  revolt
self-hosted
Deploy Revolt using Docker.
Stars: ✭ 490 (+247.52%)
Mutual labels:  revolt
delta
Monorepo for Revolt backend services.
Stars: ✭ 766 (+443.26%)
Mutual labels:  revolt
defectio
Python wrapper for Revolt https://revolt.chat
Stars: ✭ 26 (-81.56%)
Mutual labels:  revolt
revolt.py
Python wrapper for https://revolt.chat
Stars: ✭ 58 (-58.87%)
Mutual labels:  revolt
vortex
Revolt voice server
Stars: ✭ 61 (-56.74%)
Mutual labels:  revolt
revolt.chat
Revolt landing page.
Stars: ✭ 26 (-81.56%)
Mutual labels:  revolt
Taco
The Taco Revolt ~~bot~~ machine.
Stars: ✭ 14 (-90.07%)
Mutual labels:  revolt
api
Typescript typings and OpenAPI v3 generator for the Revolt API.
Stars: ✭ 23 (-83.69%)
Mutual labels:  revolt
autumn
Pluggable file server micro-service.
Stars: ✭ 27 (-80.85%)
Mutual labels:  revolt

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.[..];
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].