mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
chore(readme): clarify the use of ES modules in readme examples (#10934)
* chore(readme): clarify the use of ES modules in readme examples resolves #10932 * fix: revert api extractor readme changes
This commit is contained in:
@@ -34,6 +34,8 @@ pnpm add @discordjs/brokers
|
|||||||
|
|
||||||
## Example usage
|
## Example usage
|
||||||
|
|
||||||
|
These examples use [ES modules](https://nodejs.org/api/esm.html#enabling).
|
||||||
|
|
||||||
### pub sub
|
### pub sub
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ pnpm add @discordjs/core
|
|||||||
|
|
||||||
## Example usage
|
## Example usage
|
||||||
|
|
||||||
|
These examples use [ES modules](https://nodejs.org/api/esm.html#enabling).
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { REST } from '@discordjs/rest';
|
import { REST } from '@discordjs/rest';
|
||||||
import { WebSocketManager } from '@discordjs/ws';
|
import { WebSocketManager } from '@discordjs/ws';
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ pnpm add discord.js
|
|||||||
bun add discord.js
|
bun add discord.js
|
||||||
```
|
```
|
||||||
|
|
||||||
|
These examples use [ES modules](https://nodejs.org/api/esm.html#enabling).
|
||||||
|
|
||||||
Register a slash command against the Discord API:
|
Register a slash command against the Discord API:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ bun add @discordjs/formatters
|
|||||||
|
|
||||||
## Example usage
|
## Example usage
|
||||||
|
|
||||||
|
The example uses [ES modules](https://nodejs.org/api/esm.html#enabling).
|
||||||
|
|
||||||
````ts
|
````ts
|
||||||
import { codeBlock } from '@discordjs/formatters';
|
import { codeBlock } from '@discordjs/formatters';
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ bun add @discordjs/ws
|
|||||||
|
|
||||||
## Example usage
|
## Example usage
|
||||||
|
|
||||||
|
The example uses [ES modules](https://nodejs.org/api/esm.html#enabling).
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { WebSocketManager, WebSocketShardEvents, CompressionMethod } from '@discordjs/ws';
|
import { WebSocketManager, WebSocketShardEvents, CompressionMethod } from '@discordjs/ws';
|
||||||
import { REST } from '@discordjs/rest';
|
import { REST } from '@discordjs/rest';
|
||||||
|
|||||||
Reference in New Issue
Block a user