SHARE
TWEET

Untitled

PizzaClappsU Dec 3rd, 2019 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js");
  2. let xp = require("../xp.json");
  3.  
  4. module.exports.run = async (bot, message, arge) => {
  5.  
  6.     if(!xp[message.author.id]){
  7.     xp[message.author.id] = {
  8.         xp: 0,
  9.         level: 1
  10.     };
  11. }
  12.  
  13.     let curxp = xp[message.author.id].xp;
  14.     let curlvl = xp[message.author.id].level;
  15.     let nxtLvlXp = curlvl * 300;
  16.     let difference = nxtLvlXp - curxp;
  17.     let lvlEmbed = new Discord.RichEmbed()
  18.         .setAuthor(message.author.username)
  19.         .setColor("RED")
  20.         .addField("Level", curlvl, true)
  21.         .addField("XP", curxp, true)
  22.         .setFooter(`${difference} XP till level up`, message.author.displayAvatarURl)
  23.  
  24.         message.channel.send(lvlEmbed).then(msg => {msg.delete(5000)})
  25. }
  26.  
  27. module.exports.help = {
  28.     name: "level"
  29. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top