const { Player } = require('discord-player'); const { Client, Intents } = require('discord.js'); const mongoose = require('mongoose'); global.client = new Client({ intents: [ Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_VOICE_STATES ], disableMentions: 'everyone', }); client.config = require('./config'); global.player = new Player(client, client.config.opt.discordPlayer); require('./src/loader'); require('./src/events'); mongoose.connect(client.config.db.DATABASE_URI, { autoIndex: false, maxPoolSize: 10, serverSelectionTimeoutMS: 5000, socketTimeoutMS: 45000, family: 4, }).then(() => {console.log('Le client DB est connecté')}).catch(err => console.log(err)); client.login(client.config.app.token);