Skip to content

Commit

Permalink
docs: fix /core README example (#9201)
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx authored Mar 9, 2023
1 parent a63ac88 commit f65ac2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pnpm add @discordjs/core
```ts
import { REST } from '@discordjs/rest';
import { WebSocketManager } from '@discordjs/ws';
import { GatewayIntentBits, InteractionType, MessageFlags, Client } from '@discordjs/core';
import { GatewayDispatchEvents, GatewayIntentBits, InteractionType, MessageFlags, Client } from '@discordjs/core';

// Create REST and WebSocket managers directly
const rest = new REST({ version: '10' }).setToken(token);
Expand All @@ -51,7 +51,7 @@ const client = new Client({ rest, ws });
// Listen for interactions
// Each event contains an `api` prop along with the event data that allows you to interface with the Discord REST API
client.on(GatewayDispatchEvents.InteractionCreate, async ({ data: interaction, api }) => {
if (!(interaction.type === InteractionType.ApplicationCommand) || interaction.data.name !== 'ping') {
if (interaction.type !== InteractionType.ApplicationCommand || interaction.data.name !== 'ping') {
return;
}

Expand Down

2 comments on commit f65ac2e

@vercel
Copy link

@vercel vercel bot commented on f65ac2e Mar 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on f65ac2e Mar 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.