npm.io
0.4.0 • Published 3 years ago

@fuwa/rest

Licence
MIT
Version
0.4.0
Deps
4
Size
246 kB
Vulns
16
Weekly
0
Stars
12

@fuwa/rest

A minimal, yet feature-complete, client for Discord's public REST API. Uses undici internally.

Installation

# using yarn
$ yarn add @fuwa/rest
# or pnpm
$ pnpm add @fuwa/rest
# or even npm
$ npm install --save @fuwa/rest

Usage

import { REST } from '@fuwa/rest';

const client = new REST("my_token");

await client.patch("/users/@me", {
  body: {
    username: "fuwa_l0v3r"
  },
});

// want it simpler? here you go:
await client.editCurrentUser({
  username: "fuwa_l0v3r_shorthand"
});

Documentation

All endpoints under REST are represented by their name in the Discord Developer Docs.

Documentation is planned and on the roadmap. Check back here later.