Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. if(cmd === `${prefix}promote`){
  2. if(!message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("You do not have enough permissions to run this command. To use this command, you need the ``ADMINISTRATOR`` permission.");
  3. var username = args[0]
  4. if (username){
  5. message.channel.send()
  6. roblox.getIdFromUsername(username)
  7. .then(function(id){
  8. roblox.getRankInGroup(1112646, 622260261)
  9. .then(function(rank){
  10. if(maximumRank <= rank){
  11. message.channel.send(``)
  12. } else {
  13. message.channel.send()
  14. roblox.promote(1112646, id)
  15. .then(function(roles){
  16. message.react('✅');
  17. var embed = new Discord.RichEmbed()
  18. .setColor("#FF9900")
  19. .setAuthor(message.author.tag, message.author.avatarURL)
  20. .setDescription(`${username} has been successfully ranked from ${roles.oldRole.Name} to ${roles.newRole.Name}`)
  21. message.channel.sendEmbed(embed);
  22. }).catch(function(err){
  23. message.react('❌');
  24. message.channel.send("Error found. Trying to fix.")
  25. roblox.login({username: "CoffeeCafeRanking", password: "########"}).then((success) => {
  26.  
  27. }).catch(() => {console.log("Sorry, it failed." + message.channel.send("It seems like the roblox API services are down. Please try again soon."));});
  28.  
  29. });
  30. }
  31. }).catch(function(err){
  32. message.react('❌');
  33. message.channel.send("Couldn't get him in the group.")
  34. });
  35. }).catch(function(err){
  36. message.react('❌');
  37. message.channel.send(`Sorry, but ${username} doesn't exist on ROBLOX.`)
  38. });
  39. } else {
  40. message.react('❌');
  41. var embed = new Discord.RichEmbed()
  42. .setColor("#FF0000")
  43. .setAuthor(message.author.tag, message.author.avatarURL)
  44. .setDescription(`INVALID USAGE ;promote <USERNAME>`)
  45. message.channel.sendEmbed(embed);
  46. }
  47. return;
  48. } else {
  49. message.channel.send("")
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement