All Projects → discordjs → discord-api-types

discordjs / discord-api-types

Licence: MIT License
Up to date Discord API Typings, versioned by the API version

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to discord-api-types

DiscordBot-Template
A boilerplate / template for discord.js bots with 100% coverage of Discord API, command handler, error handler based on https://discordjs.guide/
Stars: ✭ 129 (-52.22%)
Mutual labels:  discordjs, discord-bot, discord-api, typings
Discord-Reposter
Bot for reposting Discord messages (work in progress)
Stars: ✭ 62 (-77.04%)
Mutual labels:  discordjs, discord-bot, discord-api
mass-dm-discord
A MassDM selfbot which is working in 2021. Only for educational purposes 🥱🚀
Stars: ✭ 87 (-67.78%)
Mutual labels:  discordjs, discord-bot, discord-api
Discord-Bot-TypeScript-Template
Discord bot - A discord.js bot template written with TypeScript.
Stars: ✭ 86 (-68.15%)
Mutual labels:  discordjs, discord-bot, discord-api
Commando
[DEPRECATED] ⚫ Commando Discord bot built on discord.js-commando.
Stars: ✭ 78 (-71.11%)
Mutual labels:  discordjs, discord-bot, discord-api
Discord.js
discord.js is a powerful Node.js module that allows you to easily interact with the Discord API.
Stars: ✭ 16,432 (+5985.93%)
Mutual labels:  discordjs, discord-bot, discord-api
Discord-BOT-Dashboard
This version is outdated, please check out Discord BOT Dashboard v2
Stars: ✭ 32 (-88.15%)
Mutual labels:  discordjs, discord-bot, discord-api
discord.js-modules
Modularisation of discord.js (WIP)
Stars: ✭ 210 (-22.22%)
Mutual labels:  discordjs, discord-bot, discord-api
discord.d.ts
Typings for the Discord gateway.
Stars: ✭ 24 (-91.11%)
Mutual labels:  discord-bot, discord-api, typings
discord-voice
⏲️ A complete framework to facilitate the tracking of user voice time using discord.js
Stars: ✭ 33 (-87.78%)
Mutual labels:  discordjs, discord-bot, discord-api
LenoxBot
🖥️ LenoxBot is a Discord bot that offers many cool new features to your Discord server!
Stars: ✭ 218 (-19.26%)
Mutual labels:  discordjs, discord-bot, discord-api
suggestions-bot
A Discord bot designed to build better communities by encouraging a positive and constructive relationship between community and staff.
Stars: ✭ 22 (-91.85%)
Mutual labels:  discordjs, discord-bot, discord-api
auto
A code scanner Discord bot.
Stars: ✭ 15 (-94.44%)
Mutual labels:  discord-bot, discord-api
nyxx
Wrapper around Discord API for Dart
Stars: ✭ 217 (-19.63%)
Mutual labels:  discord-bot, discord-api
necord
🤖 A module for creating Discord bots using NestJS, based on Discord.js
Stars: ✭ 77 (-71.48%)
Mutual labels:  discordjs, discord-bot
slash-level
✨ The first and only slash-command based Discord level bot ✨
Stars: ✭ 31 (-88.52%)
Mutual labels:  discordjs, discord-bot
sharedsharder
Shard your discord.js bot across devices!
Stars: ✭ 18 (-93.33%)
Mutual labels:  discordjs, discord-bot
ALi
ALi a powerful Discord bot that includes Utility, Fun, Music, Moderation, and much more! (Beta)
Stars: ✭ 97 (-64.07%)
Mutual labels:  discordjs, discord-bot
Kato-Bot
discord bot
Stars: ✭ 51 (-81.11%)
Mutual labels:  discordjs, discord-bot
Welcome-Bot
A cool multi-purpose discord bot that solves all your problems. I have features such as Moderation, ModLog, Welcome & Goodbye logs, Fun, Music
Stars: ✭ 73 (-72.96%)
Mutual labels:  discordjs, discord-bot

Discord API Types

GitHub npm deno Patreon Donate Ko-fi Donate GitHub Sponsors

Simple type definitions for the Discord API.

Installation

Install with npm / yarn / pnpm:

npm install discord-api-types
yarn add discord-api-types
pnpm add discord-api-types

Usage

You can only import this module by specifying the API version you want to target. Append /v* to the import path, where the * represents the API version. Below are some examples

const { APIUser } = require('discord-api-types/v10');
// TypeScript/ES Module support
import { APIUser } from 'discord-api-types/v10';

You may also import just certain parts of the module that you need. The possible values are: globals, gateway, gateway/v*, payloads, payloads/v*, rest, rest/v*, rpc, rpc/v*, utils, utils/v*, voice, and voice/v*. Below are some examples

const { GatewayVersion } = require('discord-api-types/gateway/v10');
// TypeScript/ES Module support
import { GatewayVersion } from 'discord-api-types/gateway/v10';

Note: The v* exports (discord-api-type/v*) include the appropriate version of gateway, payloads, rest, rpc, and utils you specified, alongside the globals exports

Deno

We also provide typings compatible with the deno runtime. You have 3 ways you can import them:

  1. Directly from GitHub
// Importing a specific API version
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v10.ts';
  1. From deno.land/x
// Importing a specific API version
import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts';
  1. From skypack.dev
// Importing a specific API version
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';

Project Structure

The exports of each API version is split into three main parts:

  • Everything exported with the API prefix represents a payload you may get from the REST API or the Gateway.

  • Everything exported with the Gateway prefix represents data that ONLY comes from or is directly related to the Gateway.

  • Everything exported with the REST prefix represents data that ONLY comes from or is directly related to the REST API.

    • For endpoint options, they will follow the following structure: REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result> where the type represents what it will return.

      • For example, RESTPostAPIChannelMessageJSONBody or RESTGetAPIGatewayBotInfoResult.

      • Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either RESTOAuth2 or with something similar to REST<HTTP Method>OAuth2

    • If a type ends with Result, then it represents the expected result by calling its accompanying route.

      • Types that are exported as never usually mean the result will be a 204 No Content, so you can safely ignore it. This does not account for errors.
  • Anything else that is miscellaneous will be exported based on what it represents (for example the REST route object).

  • There may be types exported that are identical for all versions. These will be exported as is and can be found in the globals file. They will still be prefixed accordingly as described above.

Warning: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's API Documentation repository or known through other means and have received the green light to be used). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will NOT be included.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].