Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js'); //requires the npm package
- const bot = new Discord.Client();
- const token = 'NjQ1MTA2MjA4NjcxMjY4ODg1.XdBQlA.CtDa-JDu8KnBp9OFnpSuJvdAwuA';
- const PREFIX = '!';
- const skins = require("./champions.json");
- bot.on('ready', () =>{
- console.log(`The bot ${bot.user.tag} is online!`)
- })
- bot.on('message', message=>{
- let args = message.content.substring(PREFIX.length).split(" ");
- switch(args[0]){
- case 'help':
- message.channel.send('Use ' + PREFIX + 'rng to get a random number')
- break;
- case 'play':
- function getRandomchamp() {
- return Math.floor(Math.random) * 1000);
- }
- var rng_champ = getRandomchamp();
- while(rng_champ>2){
- var rng_champ = getRandomchamp();
- }
- var champ_name = (champions[rng_champ].champ_name);
- message.channel.send(champ_name)
- break;
- }
- }
- bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement