mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
docs: Define /core token in example (#9586)
* Importing Token Importing token was missing, so I added it. It is getting the token from configuration file. It could have been done with defining a constant variable too, but importing makes more sense. * Updated Token Field to "dotenv" From now, user's can use dotenv package to keep their Discord client token. * Referring token as DISCORD_TOKEN Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com> --------- Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -39,10 +39,10 @@ import { WebSocketManager } from '@discordjs/ws';
|
|||||||
import { GatewayDispatchEvents, GatewayIntentBits, InteractionType, MessageFlags, Client } from '@discordjs/core';
|
import { GatewayDispatchEvents, GatewayIntentBits, InteractionType, MessageFlags, Client } from '@discordjs/core';
|
||||||
|
|
||||||
// Create REST and WebSocket managers directly
|
// Create REST and WebSocket managers directly
|
||||||
const rest = new REST({ version: '10' }).setToken(token);
|
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN);
|
||||||
|
|
||||||
const gateway = new WebSocketManager({
|
const gateway = new WebSocketManager({
|
||||||
token,
|
token: process.env.DISCORD_TOKEN,
|
||||||
intents: GatewayIntentBits.GuildMessages | GatewayIntentBits.MessageContent,
|
intents: GatewayIntentBits.GuildMessages | GatewayIntentBits.MessageContent,
|
||||||
rest,
|
rest,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user