Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require("discord.js");
- const fkey = require("../fortnite.json")
- const fn = require('fortnite.js');
- const f = new fn(fkey.token);
- const Client = require("fortnite");
- const fortnite = new Client(fkey.token)
- const Canvas = require('canvas');
- module.exports.run = async (client, message, args) => {
- if (message.author.id !== '224594497726578689') return;
- const username = args[0];
- const platform = args[1];
- const faa = fortnite.user("LukazEL", "pc").then(async faa => {
- const lmatches = faa.stats.lifetime.matches;
- const lwins = faa.stats.lifetime.wins;
- const solowins = faa.stats.solo.wins;
- const duowins = faa.stats.duo.wins;
- const squadwins = faa.stats.squad.wins;
- const kmatch = faa.stats.duo.kills_per_match;
- const data = f.get("LukazEL", fortnite.pc).then(async data => {
- const lkd = data.stats.kd;
- const lwinrate = data.stats.winPercent;
- // STATS SOLO
- const solokd = data.solo.kd.value;
- const solokills = data.solo.kills.value;
- const solomatches = data.solo.matches.value;
- const soloratio = data.solo.winRatio.value;
- // STATS DUO
- const duokd = data.duo.kd.value;
- const duokills = data.duo.kills.value;
- const duomatches = data.duo.matches.value;
- const duoratio = data.duo.winRatio.value;
- // STATS SQUAD
- const squadkd = data.squad.kd.value;
- const squadkills = data.squad.kills.value;
- const squadmatches = data.squad.matches.value;
- const squadratio = data.squad.winRatio.value;
- //lifetime
- const canvas = Canvas.createCanvas(1000, 650);
- const ctx = canvas.getContext('2d');
- const background = await Canvas.loadImage('./wallpaper.png');
- ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
- ctx.font = '50px GROBOLD';
- ctx.fillStyle = '#ffffff';
- ctx.fillText(`${lwinrate}`, canvas.width / 1.29, canvas.height / 5.2);
- ctx.font = '23px GROBOLD';
- ctx.fillStyle = '#ffffff';
- ctx.fillText(`${lwins}`, canvas.width / 2.65, canvas.height / 1.033);
- ctx.font = '23px GROBOLD';
- ctx.fillStyle = ' #ffffff';
- ctx.fillText(`${lkd}`, canvas.width / 1.73, canvas.height / 1.033);
- ctx.font = '23px GROBOLD';
- ctx.fillStyle = ' #ffffff';
- ctx.fillText(`${kmatch}`, canvas.width / 1.27, canvas.height / 1.033);
- ctx.font = '23px GROBOLD';
- ctx.fillStyle = ' #ffffff';
- ctx.fillText(`LukazEL`, canvas.width / 7.5, canvas.height / 1.033);
- //solos
- ctx.font = '30px GROBOLD';
- ctx.fillStyle = '#000000';
- ctx.fillText(`${solomatches}`, canvas.width / 5.5, canvas.height / 2.42);
- ctx.font = '30px GROBOLD';
- ctx.fillStyle = '#000000';
- ctx.fillText(`${solowins}`, canvas.width / 7.3, canvas.height / 1.96);
- ctx.font = '30px GROBOLD';
- ctx.fillStyle = '#000000';
- ctx.fillText(`${solokills}`, canvas.width / 5.7, canvas.height / 1.63);
- ctx.font = '30px GROBOLD';
- ctx.fillStyle = '#000000';
- ctx.fillText(`${solokd}`, canvas.width / 7.5, canvas.height / 1.4);
- ctx.font = '30px GROBOLD';
- ctx.fillStyle = '#000000';
- ctx.fillText(`${soloratio}`, canvas.width / 6, canvas.height / 1.235);
- //duos
- //squads
- //next
- ctx.beginPath();
- ctx.arc(125, 125, 125, 0, Math.PI * 2, true);
- ctx.closePath();
- ctx.clip();
- const attachment = new Discord.Attachment(canvas.toBuffer(), 'bylukazel.png');
- message.channel.send(`**Statisticile jucatorului ${username}**`, attachment);
- })}).catch(err => {
- console.log(err);
- });
- }
- module.exports.help = {
- name: "s"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement