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:
İbrahim
2023-06-09 12:41:07 +03:00
committed by GitHub
parent a531dc9f1c
commit bc2798b8ee

View File

@@ -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,
});