Compare commits

..

No commits in common. "7eb61b07007dd835e6bba1fefe6a9f785236bc6f" and "3d0fe87717b540c1d07a0c06c7dbb88b93e9ef2f" have entirely different histories.

4 changed files with 8 additions and 29 deletions

View file

@ -5,8 +5,7 @@
"es6": true
},
"parserOptions": {
"ecmaVersion": 2021,
"sourceType": "module"
"ecmaVersion": 2021
},
"rules": {
"arrow-spacing": ["warn", { "before": true, "after": true }],

View file

@ -4,8 +4,7 @@
"description": "Bot discord",
"main": "src/index.js",
"scripts": {
"main": "node .",
"eslint": "eslint src"
"main": "node ."
},
"repository": {
"type": "git",
@ -19,6 +18,5 @@
"devDependencies": {
"dotenv": "^16.0.1",
"eslint": "^8.13.0"
},
"type": "module"
}
}

View file

@ -1,4 +1,4 @@
import loadClient from './utils/client.js';
const { Client, Intents } = require('discord.js');
const run = async () => {
console.log('Starting Botanique...');
@ -10,11 +10,12 @@ const run = async () => {
}
// Client Discord.JS
const client = await loadClient().catch(() => {
throw 'Client ❌';
});
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
client.config = { token_discord: process.env.TOKEN_DISCORD };
if (client) {
console.log('Client ✅');
} else {
throw 'Client ❌';
}
await client.login(client.config.token_discord);

View file

@ -1,19 +0,0 @@
import { Client, Intents } from 'discord.js';
import { readFileSync } from 'fs';
const { version } = JSON.parse(readFileSync('./package.json'));
// Création du client et de ses propriétés
export default async () => {
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
],
});
client.config = {
version: version,
token_discord: process.env.TOKEN_DISCORD,
};
return client;
};