Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. const Discord = require('discord.js'); //requires the npm package
  2. const bot = new Discord.Client();
  3. const token = 'NjQ1MTA2MjA4NjcxMjY4ODg1.XdBQlA.CtDa-JDu8KnBp9OFnpSuJvdAwuA';
  4. const PREFIX = '!';
  5. const skins = require("./champions.json");
  6.  
  7.  
  8. bot.on('ready', () =>{
  9. console.log(`The bot ${bot.user.tag} is online!`)
  10. })
  11.  
  12. bot.on('message', message=>{
  13.  
  14. let args = message.content.substring(PREFIX.length).split(" ");
  15.  
  16. switch(args[0]){
  17. case 'help':
  18. message.channel.send('Use ' + PREFIX + 'rng to get a random number')
  19. break;
  20.  
  21.  
  22. case 'play':
  23. function getRandomchamp() {
  24. return Math.floor(Math.random) * 1000);
  25. }
  26. var rng_champ = getRandomchamp();
  27. while(rng_champ>2){
  28. var rng_champ = getRandomchamp();
  29. }
  30. var champ_name = (champions[rng_champ].champ_name);
  31.  
  32. message.channel.send(champ_name)
  33.  
  34. break;
  35.  
  36. }
  37.  
  38. }
  39. bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement