Connexion à Discord

This commit is contained in:
Mylloon 2022-04-18 15:41:35 +02:00
parent a3919a80a9
commit 3b9e101107
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

16
index.js Normal file
View file

@ -0,0 +1,16 @@
const { Client, Intents } = require('discord.js');
const dotenv = require('dotenv');
// Load .env
dotenv.config();
// Create a new client instance
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
// When the client is ready
client.once('ready', () => {
console.log('Prêt !');
});
// Login to Discord with token
client.login(process.env.DISCORD_TOKEN);