sentanos / roblox-js

!!!THIS PROJECT IS NO LONGER MAINTAINED!!! Execute ROBLOX website actions in node.js
MIT License
45 stars 45 forks source link

'rbx.getIdFromUserName' problem! #20

Closed nishi7409 closed 7 years ago

nishi7409 commented 7 years ago

Always returns with the account not being able to find the user/user doesn't exist.

Link - http://prntscr.com/evqqlr

sentanos commented 7 years ago

Please post exactly how you are calling the function.

nishi7409 commented 7 years ago

const blurb = await rbx.getBlurb(args[1] || rbx.getIdFromUserName(args[1]).then(rbx.getBlurb())); if (blurb === token) { // do stuff }

that doesn't look nice so here is an image image

sentanos commented 7 years ago

It is not a problem with getIdFromUsername, you are calling getBlurb incorrectly. First of all I don't understand the logic in the or. If args[1] exists then use it but if it doesn't call getIdFromUsername with the arg that doesn't exist? I assume you are trying to do something with userIds as well as usernames, but the easiest thing here is to just stick with one. Second you are calling rbx.getBlurb with no arguments when you should just be passing in the function.

const blurb = await rbx.getIdFromUsername(args[1]).then(rbx.getBlurb);
nishi7409 commented 7 years ago

args[1] would be the userid of said player while the rbx.getIdFromUsername(args[1]) is the username.

My idea is... !stuff 12323 or !stuff username > does stuff

sentanos commented 7 years ago

The problem is there is no way to identify between the two, someone can have a name that is all numbers that ends up being a valid userId. Anyways, this is not a problem with the module and you should have enough information to work on things on your own now.