SHARE
TWEET

Untitled

a guest Aug 20th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js");
  2. const client = new Discord.Client({ disableEveryone: true });
  3. const Enmap = require("enmap")
  4. const fs = require("fs");
  5. const exp = require("./exp.json")
  6. const config = require("./config.json")
  7.  
  8.  
  9. fs.readdir("./events", (err, files) => {
  10.     if (err) return console.log(err);
  11.     files.forEach(file => {
  12.         const event = require(`./events/${file}`);
  13.         const eventName = file.split(".")[0];
  14.         console.log(`Lancement de l'event ${eventName}`)
  15.         client.on(eventName, event.bind(null, client));
  16.     });
  17. });
  18.  
  19. client.commands = new Enmap();
  20.  
  21. fs.readdir("./commandes", (err, files) => {
  22.     if (err) console.log(err);
  23.     files.forEach(file => {
  24.         if (!file.endsWith(".js")) return;
  25.         const props = require(`./commandes/${file}`);
  26.         const commandName = file.split(".")[0];
  27.         console.log(`Lancement de la commande ${commandName}`)
  28.         client.commands.set(commandName, props);
  29.     });
  30. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top