Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. const Discord = require('discord.js');
  2. const client = new Discord.Client();
  3. const fs = require('fs');
  4.  
  5. var token = ('NTQ4MTMwODg4OTkxNTA2NDk0.D1A2iw.3X1Va_ghGQFjuDEegvZY9g0l-jA')
  6.  
  7. client.on('ready', () => {
  8. console.log(`[-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-]
  9.  
  10. » Le bot est à présent allumé!
  11. » Fait par Jus2Raisin
  12. » Version: 1.0.0
  13.  
  14. [-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-]`);
  15. });
  16.  
  17. const activities_list = [
  18. "https://discord.gg/8eJRcjZ",
  19. "RIP XXXTENTACION",
  20. "Make with ❤️",
  21. ]; // creates an arraylist containing phrases you want your bot to switch through.
  22.  
  23. client.on('ready', () => {
  24. setInterval(() => {
  25. const index = Math.floor(Math.random() * (activities_list.length - 1) + 1); // generates a random number between 1 and the length of the activities array list (in this case 5).
  26. client.user.setActivity(activities_list[index],{
  27. type: "STREAMING",
  28. url: "https://www.twitch.tv/jus2raisintv__"});
  29.  
  30. }, 3000); // Runs this every 10 seconds. 1000 = 1seconde
  31. });
  32.  
  33.  
  34.  
  35. client.commands = new Discord.Collection();
  36.  
  37. fs.readdir("./Commandes/",(error, f) => {
  38. if(error) console.log(error);
  39.  
  40. let commandes = f.filter(f => f.split(".").pop() === "js");
  41. if(commandes.length <= 0) return console.log("Aucune commandes trouvées !")
  42.  
  43. commandes.forEach((f) => {
  44.  
  45. let commande = require(`./Commands/${f}`)
  46. console.log(`${f} commandes chargés !`);
  47.  
  48. client.commandes.set(commande.help.name, commande);
  49. })
  50. });
  51.  
  52. fs.readdir("./Events/", (error, f) => {
  53. if(error) console.log(error);
  54. console.log(`${f.length} events en chargement!`);
  55.  
  56. f.forEach((f) => {
  57. const events = require(`./Events/${f}`)
  58. const event = f.split(".")[0];
  59. client.on(event, events.bind(null, client));
  60. });
  61. });
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
  103.  
  104. client.login(token)
  105.  
  106. //=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement