@discord-interactions/api
TypeScript icon, indicating that this package has built-in type declarations

0.3.21 • Public • Published

@discord-interactions/api

Discord server npm version npm downloads Tests status

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.

Installation

npm install @discord-interactions/api

Example Usage

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);
}

Credits

This code is derived from @IanMitchell's Interaction Kit: discord-api and distributed under the Apache 2 license. It was changed to use @discord-interactions/request.

Readme

Keywords

none

Package Sidebar

Install

npm i @discord-interactions/api

Weekly Downloads

87

Version

0.3.21

License

Apache-2.0

Unpacked Size

87.6 kB

Total Files

37

Last publish

Collaborators

  • ssmmiles