Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. const Discord = require('discord.js')
  2. const osu = require('node-osu');
  3. const api = new osu.Api("osu! api key" , {
  4. notFoundAsError: true,
  5. completeScores: false
  6. })
  7.  
  8. module.exports.run = async (bot, message, args) => {
  9.  
  10.  
  11. let username = args[0]
  12.  
  13.  
  14. if (!args[0]) return message.channel.send('Wprowadź Nazwę konta (osu!)')
  15.  
  16. api.getUser({u: username}).then(user => {
  17. const embed = new Discord.RichEmbed()
  18. .setTitle('osu! Standard profil')
  19. .setDescription(`użyto moduł osu!`)
  20. .setThumbnail(`http://s.ppy.sh/a/${user.id}}`)
  21. .setColor("#D0436A")
  22. .addField('Pseudonim', user.name, true)
  23. .addField('PP', Math.round(user.pp.raw), true)
  24. .addField('Rank', user.pp.rank, true)
  25. .addField('Poziom', Math.round(user.level), true)
  26. .addBlankField()
  27. .addField('Kraj', user.country, true)
  28. .addField('Krajowy Ranking', user.pp.countryRank, true)
  29. .addField('Playcount', user.counts.plays, true)
  30. .addField('Accuracy', `${user.accuracyFormatted}`, true)
  31. .setFooter('Requested By ' + message.author.tag, message.author.avatarURL)
  32. message.channel.send(embed)
  33.  
  34. })
  35.  
  36. }
  37.  
  38. module.exports.help = {
  39. name: "osu!"
  40. }
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54. -----------------------------------------------------------------------------------------------------------------------------------------------------------
  55. (node:13644) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: 401
  56. (node:13644) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate
  57. the Node.js process with a non-zero exit code.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement