Paste Search Dynamic
Discord Collection
  1. const Discord = require("discord.js");
  2. const Enmap = require("enmap");
  3. const fs = require("fs");
  4. const malScraper = require('mal-scraper');
  5. const client = new Discord.Client();
  6. const config = require("./config.json")
  7. this.queue = new Map();
  8. let image = "https://media1.tenor.com/images/fb1aa76944c156acc494fff37ebdbcfa/tenor.gif?itemid=14521920";
  9. client.commands = new Discord.Collection()
  10.  
  11.  
  12.  
  13. fs.readdir("./anime/", (err, files) => {
  14.     if (err) return console.log(err);
  15.     files.forEach(file => {
  16.         let props = require(`./anime/${file}`);
  17.         let commandName = file.split(".")[0];
  18.         console.log(`Attempting to load command ${commandName}`);
  19.         client.commands.set(commandName, props);
  20.     })
  21. })
  22.  
  23. fs.readdir("./commande/", (err, files) => {
  24.     if (err) return console.log(err);
  25.     files.forEach(file => {
  26.         let props = require(`./commande/${file}`);
  27.         let commandName = file.split(".")[0];
  28.         console.log(`Attempting to load command ${commandName}`);
  29.         client.commands.set(commandName, props);
  30.     })
  31. })
  32.  
  33. fs.readdir("./fun/", (err, files) => {
  34.     if (err) return console.log(err);
  35.     files.forEach(file => {
  36.         let props = require(`./fun/${file}`);
  37.         let commandName = file.split(".")[0];
  38.         console.log(`Attempting to load command ${commandName}`);
  39.         client.commands.set(commandName, props);
  40.     })
  41. })
  42.  
  43. fs.readdir("./alias/", (err, files) => {
  44.     if (err) return console.log(err);
  45.     files.forEach(file => {
  46.         let props = require(`./alias/${file}`);
  47.         let commandName = file.split(".")[0];
  48.         console.log(`Attempting to load command ${commandName}`);
  49.         client.commands.set(commandName, props);
  50.     })
  51. })
  52.  
  53. fs.readdir("./proprio/", (err, files) => {
  54.     if (err) return console.log(err);
  55.     files.forEach(file => {
  56.         let props = require(`./proprio/${file}`);
  57.         let commandName = file.split(".")[0];
  58.         console.log(`Attempting to load command ${commandName}`);
  59.         client.commands.set(commandName, props);
  60.     })
  61. })
  62.  
  63. fs.readdir("./music/", (err, files) => {
  64.     if (err) return console.log(err);
  65.     files.forEach(file => {
  66.         let props = require(`./music/${file}`);
  67.         let commandName = file.split(".")[0];
  68.         console.log(`Attempting to load command ${commandName}`);
  69.         client.commands.set(commandName, props);
  70.     })
  71. })
  72.  
  73. client.on("message", async message => {
  74.     if (message.author.bot) return;
  75.     if (message.content.indexOf(config.prefix) !== 0) return;
  76.     const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
  77.     const command = args.shift().toLowerCase();
  78.     const cmd = client.commands.get(command);
  79.  
  80.     if (!cmd) return;
  81.    
  82.     cmd.run(client, message, args );
  83. })
  84.  
  85.  
  86. client.on("ready",() => {
  87.     console.log(`je suis prĂȘt ${client.user.username}`) // Console.log that he is online and awake.
  88.     client.user.setActivity("ohelp" , {type : 'PLAYING'});
  89. })
  90.  
  91. client.login(config.token)});
Parsed in 0.020 seconds