Workshop
Fork Github Repo

สร้าง .env file



Last updated




Last updated
// server.js
require('dotenv').config();
// Import dependency
const { Client, Events, GatewayIntentBits } = require('discord.js');
// Create a new client instance
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
// If ready, run this node
client.once(Events.ClientReady, readyClient => {
console.log(`Ready! Logged in as ${readyClient.user.tag}`);
});
// Log in to Discord with your client's token
client.login(process.env.token);
// .env
token=...
clientId=...
guildId=...
npm install