Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(command === "stats") {
- if (message.content.endsWith(row[0].prefix + "stats")) {
- let con = mysql.createConnection({
- host: "localhost",
- user: "root",
- password: "",
- database: "links",
- });
- let conStr = "SELECT * FROM `users` WHERE `userID` = '" + message.author.id+"'";
- con.query(conStr, function(error, row) {
- if(error) throw error;
- if (row && row.length) {
- fortniteAPI.login().then(() => {
- fortniteAPI
- .getStatsBR(row[0].username, "pc", "alltime")
- .then(stats => {
- message.channel.send({embed: {
- color: 3447003,
- title: row[0].username + "'s Stats",
- fields: [
- { name: "Solo", value: `**K/D** ${stats.group.solo["k/d"]}\n**WINS** ${stats.group.solo.wins}\n**KILLS** ${stats.group.solo.kills}\n**WIN%** ${stats.group.solo["win%"]}\n**MATCHES** ${stats.group.solo.matches}`, inline: true},
- { name: "Duo", value: `**K/D** ${stats.group.duo["k/d"]}\n**WINS** ${stats.group.duo.wins}\n**KILLS** ${stats.group.duo.kills}\n**WIN%** ${stats.group.duo["win%"]}\n**MATCHES** ${stats.group.duo.matches}`, inline: true},
- { name: "Squad", value: `**K/D** ${stats.group.squad["k/d"]}\n**WINS** ${stats.group.squad.wins}\n**KILLS** ${stats.group.squad.kills}\n**WIN%** ${stats.group.squad["win%"]}\n**MATCHES** ${stats.group.squad.matches}`, inline: true},
- { name: "Total", value: `**K/D** ${stats.lifetimeStats["k/d"]}\n**WINS** ${stats.lifetimeStats.wins}\n**KILLS** ${stats.lifetimeStats.kills}\n**WIN%** ${stats.lifetimeStats["win%"]}\n**MATCHES** ${stats.lifetimeStats.matches}`},
- ]
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement