Split into multiple files #18
5 changed files with 7 additions and 12 deletions
|
@ -6,7 +6,7 @@
|
|||
### En local
|
||||
> Cloner le repo.
|
||||
|
||||
> Spécifier un fichier `.env` en suivant l'exemple [de l'exemple](example.env).
|
||||
> Renseigner le token du bot dans le fichier [./config/config.json](./config/config.json).
|
||||
|
||||
> Installer les dépendences du bot.
|
||||
```bash
|
||||
|
|
3
config/config.json
Normal file
3
config/config.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"token": "OTY1NTk4ODUyNDA3MjMwNDk0.Yl1iAg.TiE_d1FEp8jL_Y_W79Zsb9RTr7Q"
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
DISCORD_TOKEN=your-token-goes-here
|
10
index.js
10
index.js
|
@ -1,16 +1,10 @@
|
|||
const { Client, Intents } = require('discord.js');
|
||||
const dotenv = require('dotenv');
|
||||
const { token } = require('./config/config.json');
|
||||
|
||||
// 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);
|
||||
client.login(token);
|
||||
|
|
|
@ -13,8 +13,7 @@
|
|||
"author": "La confrérie du Kassoulait",
|
||||
"license": "GPL-3.0-only",
|
||||
"dependencies": {
|
||||
"discord.js": "^13.6.0",
|
||||
"dotenv": "^16.0.0"
|
||||
"discord.js": "^13.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.13.0"
|
||||
|
|
Loading…
Reference in a new issue