return
the value at function passed to .then()
var storedUserID = ROBLOX.getIdFromUsername(accountArg)
.then(function(userID) {
return userID;
});
you can then use or change the Promise
value when necessary
storedUserID = storedUserID.then(id) {
return /* change value of Promise `storedUserID` here */
});
access and pass the value to message.reply()
within .then()
storedUserID.then(function(id) {
message.reply(id);
});
or
var storedUserID = ROBLOX.getIdFromUsername(accountArg);
// later in code
storedUserID.then(function(id) {
message.reply(id);
});
No comments:
Post a Comment