Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js')
- const osu = require('node-osu');
- const api = new osu.Api("osu! api key" , {
- notFoundAsError: true,
- completeScores: false
- })
- module.exports.run = async (bot, message, args) => {
- let username = args[0]
- if (!args[0]) return message.channel.send('Wprowadź Nazwę konta (osu!)')
- api.getUser({u: username}).then(user => {
- const embed = new Discord.RichEmbed()
- .setTitle('osu! Standard profil')
- .setDescription(`użyto moduł osu!`)
- .setThumbnail(`http://s.ppy.sh/a/${user.id}}`)
- .setColor("#D0436A")
- .addField('Pseudonim', user.name, true)
- .addField('PP', Math.round(user.pp.raw), true)
- .addField('Rank', user.pp.rank, true)
- .addField('Poziom', Math.round(user.level), true)
- .addBlankField()
- .addField('Kraj', user.country, true)
- .addField('Krajowy Ranking', user.pp.countryRank, true)
- .addField('Playcount', user.counts.plays, true)
- .addField('Accuracy', `${user.accuracyFormatted}`, true)
- .setFooter('Requested By ' + message.author.tag, message.author.avatarURL)
- message.channel.send(embed)
- })
- }
- module.exports.help = {
- name: "osu!"
- }
- -----------------------------------------------------------------------------------------------------------------------------------------------------------
- (node:13644) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: 401
- (node:13644) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate
- the Node.js process with a non-zero exit code.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement