This package contains object types and a fully typed request builder for the Revolt API
This thing is very much unstable, I'm working on it.
Importing types:
import type { Message } from '@rawrxd/revolt-api';
Using the request builder:
import { API } from '@rawrxd/revolt-api';
const client = new API({
authentication: {
revolt: "bot token here"
}
});
// Sending a get request
const me = await client.get('/users/@me');
// sending a post request with URL parameters and body content
const channel_id = "something";
client.post(`/channels/${channel_id}/messages`, {
content: "message :3"
});
As of now this package doesn't contain an automated approach to updating the necessary openapi.json
file. The current version can always be obtained from the revolt api directly, for example via wget:
wget https://api.revolt.chat/openapi.json
After that, rebuild the base files by running the build task through deno.
This repository currently includes revolts openapi.json file. This file is licensed under the AGPLv3 and powers the entire generator, but isn't shipped with the final result.
Revolt: https://revolt.chat Backend Source: https://github.com/revoltchat/backend