mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-20 20:24:47 +12:00
chore: reexport rest (#8372)
This commit is contained in:
parent
a7deb8f898
commit
e5bfe2c7c2
4 changed files with 12 additions and 17 deletions
11
README.md
11
README.md
|
@ -46,19 +46,18 @@ pnpm add discord.js
|
||||||
|
|
||||||
## Example usage
|
## Example usage
|
||||||
|
|
||||||
Install all required dependencies:
|
Install discord.js:
|
||||||
|
|
||||||
```sh-session
|
```sh-session
|
||||||
npm install discord.js @discordjs/rest
|
npm install discord.js
|
||||||
yarn add discord.js @discordjs/rest
|
yarn add discord.js
|
||||||
pnpm add discord.js @discordjs/rest
|
pnpm add discord.js
|
||||||
```
|
```
|
||||||
|
|
||||||
Register a slash command against the Discord API:
|
Register a slash command against the Discord API:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { REST } = require('@discordjs/rest');
|
const { REST, Routes } = require('discord.js');
|
||||||
const { Routes } = require('discord.js');
|
|
||||||
|
|
||||||
const commands = [
|
const commands = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,19 +45,18 @@ pnpm add discord.js
|
||||||
|
|
||||||
## Example usage
|
## Example usage
|
||||||
|
|
||||||
Install all required dependencies:
|
Install discord.js:
|
||||||
|
|
||||||
```sh-session
|
```sh-session
|
||||||
npm install discord.js @discordjs/rest
|
npm install discord.js
|
||||||
yarn add discord.js @discordjs/rest
|
yarn add discord.js
|
||||||
pnpm add discord.js @discordjs/rest
|
pnpm add discord.js
|
||||||
```
|
```
|
||||||
|
|
||||||
Register a slash command against the Discord API:
|
Register a slash command against the Discord API:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const { REST } = require('@discordjs/rest');
|
const { REST, Routes } = require('discord.js');
|
||||||
const { Routes } = require('discord.js');
|
|
||||||
|
|
||||||
const commands = [
|
const commands = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -180,9 +180,6 @@ exports.WelcomeScreen = require('./structures/WelcomeScreen');
|
||||||
exports.WebSocket = require('./WebSocket');
|
exports.WebSocket = require('./WebSocket');
|
||||||
|
|
||||||
// External
|
// External
|
||||||
exports.DiscordAPIError = require('@discordjs/rest').DiscordAPIError;
|
|
||||||
exports.HTTPError = require('@discordjs/rest').HTTPError;
|
|
||||||
exports.RateLimitError = require('@discordjs/rest').RateLimitError;
|
|
||||||
|
|
||||||
__exportStar(require('discord-api-types/v10'), exports);
|
__exportStar(require('discord-api-types/v10'), exports);
|
||||||
__exportStar(require('@discordjs/builders'), exports);
|
__exportStar(require('@discordjs/builders'), exports);
|
||||||
|
__exportStar(require('@discordjs/rest'), exports);
|
||||||
|
|
2
packages/discord.js/typings/index.d.ts
vendored
2
packages/discord.js/typings/index.d.ts
vendored
|
@ -5622,4 +5622,4 @@ export type InternalDiscordGatewayAdapterCreator = (
|
||||||
// External
|
// External
|
||||||
export * from 'discord-api-types/v10';
|
export * from 'discord-api-types/v10';
|
||||||
export * from '@discordjs/builders';
|
export * from '@discordjs/builders';
|
||||||
export { DiscordAPIError, HTTPError, RateLimitError } from '@discordjs/rest';
|
export * from '@discordjs/rest';
|
||||||
|
|
Loading…
Reference in a new issue