A Discord HTTP client that handles global and resource rate limits automatically
A simple, typed wrapper around the Discord API.
This package is built on top of @discord-interactions/request and discord-api-types - it is fully typed and handles rate limits appropriately.
It is used internally within @discord-interactions/core, but can easily be used outside of this context.
npm install @discord-interactions/api
``ts
import { client } from "discord-api";
try {
const response = await client.postGlobalApplicationCommand(
process.env.APPLICATION_ID,
payload
);
} catch (error: unknown) {
console.error((error as Error).message);
}
`