SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 327 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js");
  2. const fkey = require("../fortnite.json")
  3. const fn = require('fortnite.js');
  4. const f = new fn(fkey.token);
  5. const Client = require("fortnite");
  6. const fortnite = new Client(fkey.token)
  7. const Canvas = require('canvas');
  8. module.exports.run = async (client, message, args) => {
  9.  
  10.   if (message.author.id !== '224594497726578689') return;
  11.  
  12.  
  13.   const username = args[0];
  14.   const platform = args[1];
  15.  
  16.   const faa = fortnite.user("LukazEL", "pc").then(async faa => {
  17.    
  18.     const lmatches = faa.stats.lifetime.matches;
  19.     const lwins = faa.stats.lifetime.wins;
  20.     const solowins = faa.stats.solo.wins;
  21.     const duowins = faa.stats.duo.wins;
  22.     const squadwins = faa.stats.squad.wins;
  23.     const kmatch = faa.stats.duo.kills_per_match;
  24.  
  25.   const data = f.get("LukazEL", fortnite.pc).then(async data => {
  26.    
  27.     const lkd = data.stats.kd;
  28.     const lwinrate = data.stats.winPercent;
  29.                
  30.     // STATS SOLO
  31.              
  32.     const solokd = data.solo.kd.value;            
  33.     const solokills = data.solo.kills.value;              
  34.     const solomatches = data.solo.matches.value;              
  35.     const soloratio = data.solo.winRatio.value;
  36.                              
  37.     // STATS DUO
  38.                
  39.     const duokd = data.duo.kd.value;                            
  40.     const duokills = data.duo.kills.value;                
  41.     const duomatches = data.duo.matches.value;                              
  42.     const duoratio = data.duo.winRatio.value;
  43.                
  44.     // STATS SQUAD
  45.                
  46.     const squadkd = data.squad.kd.value;              
  47.     const squadkills = data.squad.kills.value;                
  48.     const squadmatches = data.squad.matches.value;          
  49.     const squadratio = data.squad.winRatio.value;
  50.     //lifetime
  51.  
  52.     const canvas = Canvas.createCanvas(1000, 650);
  53.     const ctx = canvas.getContext('2d');
  54.     const background = await Canvas.loadImage('./wallpaper.png');
  55.  
  56.     ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
  57.    
  58.     ctx.font = '50px GROBOLD';
  59.     ctx.fillStyle = '#ffffff';
  60.     ctx.fillText(`${lwinrate}`, canvas.width / 1.29, canvas.height / 5.2);
  61.    
  62.     ctx.font = '23px GROBOLD';
  63.     ctx.fillStyle = '#ffffff';
  64.     ctx.fillText(`${lwins}`, canvas.width / 2.65, canvas.height / 1.033);
  65.  
  66.     ctx.font = '23px GROBOLD';
  67.     ctx.fillStyle = '   #ffffff';
  68.     ctx.fillText(`${lkd}`, canvas.width / 1.73, canvas.height / 1.033);
  69.  
  70.     ctx.font = '23px GROBOLD';
  71.     ctx.fillStyle = '   #ffffff';
  72.     ctx.fillText(`${kmatch}`, canvas.width / 1.27, canvas.height / 1.033);
  73.    
  74.     ctx.font = '23px GROBOLD';
  75.     ctx.fillStyle = '   #ffffff';
  76.     ctx.fillText(`LukazEL`, canvas.width / 7.5, canvas.height / 1.033);
  77.  
  78.     //solos
  79.  
  80.     ctx.font = '30px GROBOLD';
  81.     ctx.fillStyle = '#000000';
  82.     ctx.fillText(`${solomatches}`, canvas.width / 5.5, canvas.height / 2.42);
  83.    
  84.     ctx.font = '30px GROBOLD';
  85.     ctx.fillStyle = '#000000';
  86.     ctx.fillText(`${solowins}`, canvas.width / 7.3, canvas.height / 1.96);
  87.  
  88.     ctx.font = '30px GROBOLD';
  89.     ctx.fillStyle = '#000000';
  90.     ctx.fillText(`${solokills}`, canvas.width / 5.7, canvas.height / 1.63);
  91.  
  92.     ctx.font = '30px GROBOLD';
  93.     ctx.fillStyle = '#000000';
  94.     ctx.fillText(`${solokd}`, canvas.width / 7.5, canvas.height / 1.4);
  95.  
  96.     ctx.font = '30px GROBOLD';
  97.     ctx.fillStyle = '#000000';
  98.     ctx.fillText(`${soloratio}`, canvas.width / 6, canvas.height / 1.235);
  99.    
  100.     //duos
  101.  
  102.     //squads
  103.  
  104.     //next
  105.  
  106.     ctx.beginPath();
  107.     ctx.arc(125, 125, 125, 0, Math.PI * 2, true);
  108.     ctx.closePath();
  109.     ctx.clip();
  110.  
  111.     const attachment = new Discord.Attachment(canvas.toBuffer(), 'bylukazel.png');
  112.    
  113.    
  114.     message.channel.send(`**Statisticile jucatorului ${username}**`, attachment);
  115. })}).catch(err => {
  116.     console.log(err);
  117. });
  118.  
  119. }
  120. module.exports.help = {
  121.   name: "s"
  122. }
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