Change .env to config.json

Co-authored-by: loonatiny <fr.tanyan@gmail.com>
This commit is contained in:
Mylloon 2022-06-18 01:01:43 +02:00
parent fd2df7aee9
commit 9fcafc9de4
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
5 changed files with 7 additions and 12 deletions

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"