Guest User

Untitled

a guest
Jan 1st, 2020
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. const Discord = require('discord.js')
  2. const bot = new Discord.Client()
  3.  
  4. bot.on("ready", () => {
  5. bot.user.setActivity('ouvrir des box');
  6. console.log(`Bot en ligne!\n${bot.users.size} utilisateurs, dans ${bot.guilds.size} serveurs connectés.`);
  7. });
  8.  
  9. var randnum = 0;
  10.  
  11. function random(min, max) {
  12. min = Math.ceil(0);
  13. max = Math.floor(1000);
  14. randnum = Math.floor(Math.random() * (max - min +1) +min);
  15. }
  16.  
  17. bot.login('NjYxOTE1NzY0MDg5MDI4NjE5.XgyYYA.qv_GyafDoxLb4oVgdHBhMtupYzc')
  18.  
  19.  
  20. bot.on('message', message =>{
  21.  
  22. if(message.content == '$box use' && message.member.roles.has(661920046242856991)){
  23. random();
  24.  
  25. if (randnum == 0 ){
  26. message.reply('Tu as gagné le paradis 4!')
  27. console.log(randnum);
  28. }
  29.  
  30. if (randnum >= 1 && randnum <= 5){
  31. message.reply('Tu as gagné le paradis 3! ')
  32. console.log(randnum);
  33. }
  34.  
  35. if (randnum >= 6 && randnum <= 55){
  36. message.reply('Tu as gagné le paradis 2!')
  37. console.log(randnum);
  38. }
  39.  
  40. if (randnum >= 56 && randnum <= 205){
  41. message.reply('Tu as gagné le paradis 1!')
  42. console.log(randnum);
  43. }
  44. if (randnum >= 206 && randnum <= 255){
  45. message.reply('Tu as gagné la banque de bourgeoisie!')
  46. console.log(randnum);
  47. }
  48.  
  49. if (randnum >= 256 && randnum <= 295){
  50. message.reply('Tu as gagné un role VIP!')
  51. console.log(randnum);
  52. }
  53.  
  54. if (randnum >= 296 && randnum <= 445){
  55. message.reply('Tu as gagné le rôle Peintre!')
  56. console.log(randnum);
  57. }
  58.  
  59. if (randnum >= 446 && randnum <= 449){
  60. message.reply('Tu as gagné 1 million de poulets !')
  61. console.log(randnum);
  62. }
  63.  
  64. if (randnum >= 450 && randnum <= 499){
  65. message.reply('Tu as gagné 100k de poulets!')
  66. console.log(randnum);
  67. }
  68.  
  69. if (randnum == 500 && randnum <= 649){
  70. message.reply('Tu as gagné 10000 poulets!')
  71. console.log(randnum);
  72. }
  73.  
  74. if (randnum >= 650 && randnum <= 749){
  75. message.reply('Tu as gagné 12000 poulets!')
  76. console.log(randnum);
  77. }
  78. if (randnum == 750 && randnum <= 899){
  79. message.reply('Tu as gagné 5000 poulets!')
  80. console.log(randnum);
  81. }
  82.  
  83. if (randnum == 900 && randnum <= 1000){
  84. message.reply("Tu as gagné 1000 poulets")
  85. console.log(randnum);
  86. }
  87. }
  88. else {
  89. message.channel.send("Tu n'as pas le rôle pour ouvrir des box")
  90. }
  91. })
Advertisement
Add Comment
Please, Sign In to add comment