Connexion à Discord
This commit is contained in:
parent
a3919a80a9
commit
3b9e101107
1 changed files with 16 additions and 0 deletions
16
index.js
Normal file
16
index.js
Normal 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);
|
Loading…
Reference in a new issue