Change .env to config.json
Co-authored-by: loonatiny <fr.tanyan@gmail.com>
This commit is contained in:
parent
fd2df7aee9
commit
9fcafc9de4
5 changed files with 7 additions and 12 deletions
|
@ -6,7 +6,7 @@
|
||||||
### En local
|
### En local
|
||||||
> Cloner le repo.
|
> 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.
|
> Installer les dépendences du bot.
|
||||||
```bash
|
```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 { 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] });
|
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
|
||||||
|
|
||||||
// When the client is ready
|
|
||||||
client.once('ready', () => {
|
client.once('ready', () => {
|
||||||
console.log('Prêt !');
|
console.log('Prêt !');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Login to Discord with token
|
client.login(token);
|
||||||
client.login(process.env.DISCORD_TOKEN);
|
|
||||||
|
|
|
@ -13,8 +13,7 @@
|
||||||
"author": "La confrérie du Kassoulait",
|
"author": "La confrérie du Kassoulait",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"discord.js": "^13.6.0",
|
"discord.js": "^13.6.0"
|
||||||
"dotenv": "^16.0.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "^8.13.0"
|
"eslint": "^8.13.0"
|
||||||
|
|
Loading…
Reference in a new issue