Describe the bug
Basically, I'm trying to use the ${newRole.Name} feature but it's not working. The logs say "TypeError: Cannot read property 'Name' of undefined"
The code I'm using this in is:
if (username){
message.channel.send(`Checking ROBLOX for ${username}`)
roblox.getIdFromUsername(username)
.then(function(id){
roblox.getRankInGroup(groupId, id)
.then(function(rank){
if(maximumRank <= rank){
message.channel.send(`${id} is rank ${rank} and not promotable.`)
} else {
message.channel.send(`${id} is rank ${rank} and promotable.`)
roblox.setRank(groupId, id, rankIdentifier)
.then(function(newRole){
message.channel.send(`Changed rank to ${newRole.Name}`)
}).catch(function(err){
console.error(err)
message.channel.send("Failed to change rank.")
});
Expected behavior
I believed that this would have the bot say the user's current rank, but it goes to the error statement.
Describe the bug Basically, I'm trying to use the
${newRole.Name}
feature but it's not working. The logs say "TypeError: Cannot read property 'Name' of undefined"The code I'm using this in is:
Expected behavior I believed that this would have the bot say the user's current rank, but it goes to the error statement.