🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@discord-interactions/api

Package Overview
Dependencies
Maintainers
0
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@discord-interactions/api

A Discord HTTP client that handles global and resource rate limits automatically

0.3.21
latest
npm
Version published
Maintainers
0
Created
Source

@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.

FAQs

Package last updated on 28 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts