sentanos / roblox-js

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

Issue with getBlurb #36

Closed Conmmander closed 7 years ago

Conmmander commented 7 years ago

I've been trying to create my bot as some sort of verification bot using roblox's blurb feature. I searched around inside Roblox-Js and came up with GetBlurb inside of util. I'm not sure if that effects it, but when I attempt to run it I get this error: Promise { _bitField: 0, _fulfillmentHandler0: undefined, _rejectionHandler0: undefined, _promise0: undefined, _receiver0: undefined }

I'm not sure what that means, and am hoping for some assistance.

-Thanks!

sentanos commented 7 years ago

This is not an error, you are using the function incorrectly. Please post the code you are using.

Conmmander commented 7 years ago

Oh. I apologize. Here is my code: if(message.content.toLowerCase().startsWith(".verifyme")) { var PlayerIDString = message.content.toLowerCase().slice(10); rbxlogin(); var blurb = robloxjs.getBlurb({userId: PlayerIDString}); var index = verifycodes.indexOf(blurb); console.log(blurb); console.log("Made it this far3"); if (index > -1) { console.log("Made it this far4") verifycodes.splice(index, 1); console.log("Made it this far") message.reply("You have been registered"); }

}
sentanos commented 7 years ago

Remember that nearly all roblox-js functions return promises, to use getBlurb you would have to do something like this:

robloxjs.getBlurb({userId: PlayerIDString})
.then(function (blurb) {
  var index = verifycodes.indexOf(blurb);
  // blah blah blah
});
Conmmander commented 7 years ago

Thank you. I appreciate your help.