Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(cmd === `${prefix}promote`){
- 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.");
- var username = args[0]
- if (username){
- message.channel.send()
- roblox.getIdFromUsername(username)
- .then(function(id){
- roblox.getRankInGroup(1112646, 622260261)
- .then(function(rank){
- if(maximumRank <= rank){
- message.channel.send(``)
- } else {
- message.channel.send()
- roblox.promote(1112646, id)
- .then(function(roles){
- message.react('✅');
- var embed = new Discord.RichEmbed()
- .setColor("#FF9900")
- .setAuthor(message.author.tag, message.author.avatarURL)
- .setDescription(`${username} has been successfully ranked from ${roles.oldRole.Name} to ${roles.newRole.Name}`)
- message.channel.sendEmbed(embed);
- }).catch(function(err){
- message.react('❌');
- message.channel.send("Error found. Trying to fix.")
- roblox.login({username: "CoffeeCafeRanking", password: "########"}).then((success) => {
- }).catch(() => {console.log("Sorry, it failed." + message.channel.send("It seems like the roblox API services are down. Please try again soon."));});
- });
- }
- }).catch(function(err){
- message.react('❌');
- message.channel.send("Couldn't get him in the group.")
- });
- }).catch(function(err){
- message.react('❌');
- message.channel.send(`Sorry, but ${username} doesn't exist on ROBLOX.`)
- });
- } else {
- message.react('❌');
- var embed = new Discord.RichEmbed()
- .setColor("#FF0000")
- .setAuthor(message.author.tag, message.author.avatarURL)
- .setDescription(`INVALID USAGE ;promote <USERNAME>`)
- message.channel.sendEmbed(embed);
- }
- return;
- } else {
- message.channel.send("")
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement