Split into multiple files #18

Merged
Anri merged 22 commits from dev into main 2022-07-03 18:43:31 +02:00
5 changed files with 7 additions and 12 deletions
Showing only changes of commit 9fcafc9de4 - Show all commits

View file

@ -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
View file

@ -0,0 +1,3 @@
{
"token": "OTY1NTk4ODUyNDA3MjMwNDk0.Yl1iAg.TiE_d1FEp8jL_Y_W79Zsb9RTr7Q"
}

View file

@ -1 +0,0 @@
DISCORD_TOKEN=your-token-goes-here

View file

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

View file

@ -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"