Advertisement
Guest User

Untitled

a guest
Jul 25th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. if(command === "stats") {
  2. if (message.content.endsWith(row[0].prefix + "stats")) {
  3. let con = mysql.createConnection({
  4. host: "localhost",
  5. user: "root",
  6. password: "",
  7. database: "links",
  8. });
  9. let conStr = "SELECT * FROM `users` WHERE `userID` = '" + message.author.id+"'";
  10. con.query(conStr, function(error, row) {
  11. if(error) throw error;
  12. if (row && row.length) {
  13. fortniteAPI.login().then(() => {
  14. fortniteAPI
  15. .getStatsBR(row[0].username, "pc", "alltime")
  16. .then(stats => {
  17. message.channel.send({embed: {
  18. color: 3447003,
  19. title: row[0].username + "'s Stats",
  20. fields: [
  21. { 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},
  22. { 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},
  23. { 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},
  24. { 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}`},
  25. ]
  26. }
  27. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement