mirror of
https://github.com/discordjs/discord.js.git
synced 2026-09-18 09:17:28 +00: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:
co-authored by
Jaw0r3k
kodiakhq[bot]
parent
a531dc9f1c
commit
bc2798b8ee
@@ -39,10 +39,10 @@ import { WebSocketManager } from '@discordjs/ws';
|
||||
import { GatewayDispatchEvents, GatewayIntentBits, InteractionType, MessageFlags, Client } from '@discordjs/core';
|
||||
|
||||
// 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({
|
||||
token,
|
||||
token: process.env.DISCORD_TOKEN,
|
||||
intents: GatewayIntentBits.GuildMessages | GatewayIntentBits.MessageContent,
|
||||
rest,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user