const options = require('../options.js')
-const getCurrentUser = require('../util/getCurrentUser.js').func
+const getAuthenticatedUser = require('../util/getAuthenticatedUser.js').func
exports.required = ['cookie']
exports.optional = ['validate']
@@ -159,7 +159,7 @@ lib/client/setCookie.js
* @alias setCookie
* @param {string} cookie - The cookie to sign in with.
* @param {boolean=} [validate=true] - Whether to validate the cookie or not.
- * @returns {Promise<LoggedInUserData>}
+ * @returns {Promise<AuthenticatedUserData>}
* @example const noblox = require("noblox.js")
* noblox.setCookie("cookie").then(function() {
* //your code here
@@ -176,7 +176,7 @@ lib/client/setCookie.js
return false
}
try {
- const res = await getCurrentUser({ jar: { session: args.cookie } })
+ const res = await getAuthenticatedUser({ jar: { session: args.cookie } })
options.jar.session = args.cookie
return res
} catch (error) {
diff --git a/lib_datastores_deleteDatastoreEntry.js.html b/lib_datastores_deleteDatastoreEntry.js.html
index d7c522f5..831acd82 100644
--- a/lib_datastores_deleteDatastoreEntry.js.html
+++ b/lib_datastores_deleteDatastoreEntry.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_datastores_getDatastoreEntry.js.html b/lib_datastores_getDatastoreEntry.js.html
index 0714c304..32c3d9fe 100644
--- a/lib_datastores_getDatastoreEntry.js.html
+++ b/lib_datastores_getDatastoreEntry.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_datastores_getDatastoreEntryVersions.js.html b/lib_datastores_getDatastoreEntryVersions.js.html
index 92fb050f..fa2465d0 100644
--- a/lib_datastores_getDatastoreEntryVersions.js.html
+++ b/lib_datastores_getDatastoreEntryVersions.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_datastores_getDatastoreKeys.js.html b/lib_datastores_getDatastoreKeys.js.html
index 7628d7a2..a0c25aa8 100644
--- a/lib_datastores_getDatastoreKeys.js.html
+++ b/lib_datastores_getDatastoreKeys.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_datastores_getDatastores.js.html b/lib_datastores_getDatastores.js.html
index d3aa8e85..555a1b8f 100644
--- a/lib_datastores_getDatastores.js.html
+++ b/lib_datastores_getDatastores.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_datastores_incrementDatastoreEntry.js.html b/lib_datastores_incrementDatastoreEntry.js.html
index 8e2a8ab4..41096202 100644
--- a/lib_datastores_incrementDatastoreEntry.js.html
+++ b/lib_datastores_incrementDatastoreEntry.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_datastores_setDatastoreEntry.js.html b/lib_datastores_setDatastoreEntry.js.html
index 9e00182b..afd50863 100644
--- a/lib_datastores_setDatastoreEntry.js.html
+++ b/lib_datastores_setDatastoreEntry.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_develop_canManage.js.html b/lib_develop_canManage.js.html
index a6cc3970..2feaa48b 100644
--- a/lib_develop_canManage.js.html
+++ b/lib_develop_canManage.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_develop_configureItem.js.html b/lib_develop_configureItem.js.html
index 299899c0..1d93791c 100644
--- a/lib_develop_configureItem.js.html
+++ b/lib_develop_configureItem.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_develop_updateUniverse.js.html b/lib_develop_updateUniverse.js.html
index f1dab4aa..6872cdd8 100644
--- a/lib_develop_updateUniverse.js.html
+++ b/lib_develop_updateUniverse.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_develop_updateUniverseAccess.js.html b/lib_develop_updateUniverseAccess.js.html
index 8fb62bf0..e6e3d9d1 100644
--- a/lib_develop_updateUniverseAccess.js.html
+++ b/lib_develop_updateUniverseAccess.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_economy_buy.js.html b/lib_economy_buy.js.html
index bad88a0d..470c59ea 100644
--- a/lib_economy_buy.js.html
+++ b/lib_economy_buy.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_economy_getGroupFunds.js.html b/lib_economy_getGroupFunds.js.html
index e3dfe371..f57a17d0 100644
--- a/lib_economy_getGroupFunds.js.html
+++ b/lib_economy_getGroupFunds.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_economy_getGroupRevenueSummary.js.html b/lib_economy_getGroupRevenueSummary.js.html
index 2522f8d3..3745d81c 100644
--- a/lib_economy_getGroupRevenueSummary.js.html
+++ b/lib_economy_getGroupRevenueSummary.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_economy_getGroupTransactions.js.html b/lib_economy_getGroupTransactions.js.html
index 38207f69..f9a1b286 100644
--- a/lib_economy_getGroupTransactions.js.html
+++ b/lib_economy_getGroupTransactions.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_economy_getResaleData.js.html b/lib_economy_getResaleData.js.html
index df208f51..f35b7ef9 100644
--- a/lib_economy_getResaleData.js.html
+++ b/lib_economy_getResaleData.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_economy_getResellers.js.html b/lib_economy_getResellers.js.html
index 0436e942..1e12c7b0 100644
--- a/lib_economy_getResellers.js.html
+++ b/lib_economy_getResellers.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_economy_getUserFunds.js.html b/lib_economy_getUserFunds.js.html
new file mode 100644
index 00000000..16c8adcb
--- /dev/null
+++ b/lib_economy_getUserFunds.js.html
@@ -0,0 +1,214 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ noblox.js lib/economy/getUserFunds.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Source
+ lib/economy/getUserFunds.js
+
+
+
+
+
+
+
+
+ // Includes
+const http = require('../util/http.js').func
+
+// Args
+exports.required = ['userId']
+exports.optional = ['jar']
+
+// Docs
+/**
+ * 🔓 Gets the amount of robux for the authenticated user.
+ * @category User
+ * @param {number} userId - Must match the userId of the authenticated user
+ * @alias getUserFunds
+ * @returns {Promise<number>}
+ * @example const noblox = require("noblox.js")
+ * // Login using your cookie
+ * const currentUser = await noblox.setCookie(process.env.ROBLOXCOOKIE)
+ * const robux = await noblox.getUserFunds(currentUser.id)
+ */
+
+// Define
+function getUserFunds (userId, jar) {
+ return http({
+ url: `//economy.roblox.com/v1/users/${userId}/currency`,
+ options: {
+ jar,
+ resolveWithFullResponse: true
+ }
+ })
+ .then(({ statusCode, body }) => {
+ const { robux, errors } = JSON.parse(body)
+ if (statusCode === 200) {
+ return robux
+ } else if (statusCode === 400 || statusCode === 403) {
+ throw new Error(`${errors[0].message} | userId: ${userId}`)
+ } else {
+ throw new Error(`An unknown error occurred with getUserFunds() | [${statusCode}] userId: ${userId}`)
+ }
+ })
+}
+
+exports.func = function ({ userId, jar }) {
+ return getUserFunds(userId, jar)
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/lib_economy_getUserTransactions.js.html b/lib_economy_getUserTransactions.js.html
index 4dc85e22..ae02237b 100644
--- a/lib_economy_getUserTransactions.js.html
+++ b/lib_economy_getUserTransactions.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_economy_onGroupTransaction.js.html b/lib_economy_onGroupTransaction.js.html
index 01abd6a2..6e62929a 100644
--- a/lib_economy_onGroupTransaction.js.html
+++ b/lib_economy_onGroupTransaction.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_friends_acceptFriendRequest.js.html b/lib_friends_acceptFriendRequest.js.html
index 0353bd96..24b5db39 100644
--- a/lib_friends_acceptFriendRequest.js.html
+++ b/lib_friends_acceptFriendRequest.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_friends_declineAllFriendRequests.js.html b/lib_friends_declineAllFriendRequests.js.html
index 1b34a119..cae7e4e5 100644
--- a/lib_friends_declineAllFriendRequests.js.html
+++ b/lib_friends_declineAllFriendRequests.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_friends_declineFriendRequest.js.html b/lib_friends_declineFriendRequest.js.html
index 185399ad..d77c3378 100644
--- a/lib_friends_declineFriendRequest.js.html
+++ b/lib_friends_declineFriendRequest.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_friends_getFollowers.js.html b/lib_friends_getFollowers.js.html
index f8454a88..9d6c2ae3 100644
--- a/lib_friends_getFollowers.js.html
+++ b/lib_friends_getFollowers.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_friends_getFollowings.js.html b/lib_friends_getFollowings.js.html
index 9f3efcc3..1ad14fa2 100644
--- a/lib_friends_getFollowings.js.html
+++ b/lib_friends_getFollowings.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_friends_getFriendRequests.js.html b/lib_friends_getFriendRequests.js.html
index bb2d4ef5..d4bfffa0 100644
--- a/lib_friends_getFriendRequests.js.html
+++ b/lib_friends_getFriendRequests.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_friends_getFriends.js.html b/lib_friends_getFriends.js.html
index 231a8c8e..e3172f8d 100644
--- a/lib_friends_getFriends.js.html
+++ b/lib_friends_getFriends.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_friends_onFriendRequest.js.html b/lib_friends_onFriendRequest.js.html
index 3e8fe9ec..fc143388 100644
--- a/lib_friends_onFriendRequest.js.html
+++ b/lib_friends_onFriendRequest.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_friends_removeFriend.js.html b/lib_friends_removeFriend.js.html
index 3a65d577..e308230a 100644
--- a/lib_friends_removeFriend.js.html
+++ b/lib_friends_removeFriend.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_friends_sendFriendRequest.js.html b/lib_friends_sendFriendRequest.js.html
index 9c0a78e7..5099b56b 100644
--- a/lib_friends_sendFriendRequest.js.html
+++ b/lib_friends_sendFriendRequest.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_friends_unfollow.js.html b/lib_friends_unfollow.js.html
index 40a96bdd..a34e0405 100644
--- a/lib_friends_unfollow.js.html
+++ b/lib_friends_unfollow.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_games_addDeveloperProduct.js.html b/lib_games_addDeveloperProduct.js.html
index d845bb7f..7ddde629 100644
--- a/lib_games_addDeveloperProduct.js.html
+++ b/lib_games_addDeveloperProduct.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_games_configureGamePass.js.html b/lib_games_configureGamePass.js.html
index 510636d9..24cb8a48 100644
--- a/lib_games_configureGamePass.js.html
+++ b/lib_games_configureGamePass.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_games_getDeveloperProducts.js.html b/lib_games_getDeveloperProducts.js.html
index 133be262..18c05eaf 100644
--- a/lib_games_getDeveloperProducts.js.html
+++ b/lib_games_getDeveloperProducts.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_games_getGameInstances.js.html b/lib_games_getGameInstances.js.html
index eafeb522..58d269a3 100644
--- a/lib_games_getGameInstances.js.html
+++ b/lib_games_getGameInstances.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_games_getGamePasses.js.html b/lib_games_getGamePasses.js.html
index d92589c7..b189f8b1 100644
--- a/lib_games_getGamePasses.js.html
+++ b/lib_games_getGamePasses.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_games_getGameRevenue.js.html b/lib_games_getGameRevenue.js.html
index ddf8c22a..1b5cb31c 100644
--- a/lib_games_getGameRevenue.js.html
+++ b/lib_games_getGameRevenue.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_games_getGameSocialLinks.js.html b/lib_games_getGameSocialLinks.js.html
index d8634f87..b3cd274e 100644
--- a/lib_games_getGameSocialLinks.js.html
+++ b/lib_games_getGameSocialLinks.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_games_getGroupGames.js.html b/lib_games_getGroupGames.js.html
index 29fd8b54..fc00d56f 100644
--- a/lib_games_getGroupGames.js.html
+++ b/lib_games_getGroupGames.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_games_getPlaceInfo.js.html b/lib_games_getPlaceInfo.js.html
index fffcb57b..224bab4d 100644
--- a/lib_games_getPlaceInfo.js.html
+++ b/lib_games_getPlaceInfo.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_games_getUniverseInfo.js.html b/lib_games_getUniverseInfo.js.html
index a2678486..f4174890 100644
--- a/lib_games_getUniverseInfo.js.html
+++ b/lib_games_getUniverseInfo.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_games_publishToTopic.js.html b/lib_games_publishToTopic.js.html
index 559a8b8e..4777deb3 100644
--- a/lib_games_publishToTopic.js.html
+++ b/lib_games_publishToTopic.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_games_updateDeveloperProduct.js.html b/lib_games_updateDeveloperProduct.js.html
index d8e99593..585886e1 100644
--- a/lib_games_updateDeveloperProduct.js.html
+++ b/lib_games_updateDeveloperProduct.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_changeRank.js.html b/lib_groups_changeRank.js.html
index 55bd1343..e18e4e7c 100644
--- a/lib_groups_changeRank.js.html
+++ b/lib_groups_changeRank.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_deleteWallPost.js.html b/lib_groups_deleteWallPost.js.html
index c46c8760..c0358dc2 100644
--- a/lib_groups_deleteWallPost.js.html
+++ b/lib_groups_deleteWallPost.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_deleteWallPostsByUser.js.html b/lib_groups_deleteWallPostsByUser.js.html
index 0e51301d..77e9122c 100644
--- a/lib_groups_deleteWallPostsByUser.js.html
+++ b/lib_groups_deleteWallPostsByUser.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_demote.js.html b/lib_groups_demote.js.html
index 0af4fe3a..12208187 100644
--- a/lib_groups_demote.js.html
+++ b/lib_groups_demote.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_exile.js.html b/lib_groups_exile.js.html
index 6bd90c1a..df2f4852 100644
--- a/lib_groups_exile.js.html
+++ b/lib_groups_exile.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_getAuditLog.js.html b/lib_groups_getAuditLog.js.html
index 1c8e708d..6dc6d83d 100644
--- a/lib_groups_getAuditLog.js.html
+++ b/lib_groups_getAuditLog.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_getGroup.js.html b/lib_groups_getGroup.js.html
index 7eb36273..c4609271 100644
--- a/lib_groups_getGroup.js.html
+++ b/lib_groups_getGroup.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_getGroupSocialLinks.js.html b/lib_groups_getGroupSocialLinks.js.html
index 22234d1d..43bbada2 100644
--- a/lib_groups_getGroupSocialLinks.js.html
+++ b/lib_groups_getGroupSocialLinks.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_getGroups.js.html b/lib_groups_getGroups.js.html
index 3da5e05b..4fe7c330 100644
--- a/lib_groups_getGroups.js.html
+++ b/lib_groups_getGroups.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_getJoinRequest.js.html b/lib_groups_getJoinRequest.js.html
index 41976040..2a5b2aa6 100644
--- a/lib_groups_getJoinRequest.js.html
+++ b/lib_groups_getJoinRequest.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_getJoinRequests.js.html b/lib_groups_getJoinRequests.js.html
index a9dbbdb2..6267bd45 100644
--- a/lib_groups_getJoinRequests.js.html
+++ b/lib_groups_getJoinRequests.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_getPlayers.js.html b/lib_groups_getPlayers.js.html
index 690aba8b..037145b6 100644
--- a/lib_groups_getPlayers.js.html
+++ b/lib_groups_getPlayers.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_getRankInGroup.js.html b/lib_groups_getRankInGroup.js.html
index 343eacf6..8dcdcd29 100644
--- a/lib_groups_getRankInGroup.js.html
+++ b/lib_groups_getRankInGroup.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_getRankNameInGroup.js.html b/lib_groups_getRankNameInGroup.js.html
index 6ab6832f..35ab71c8 100644
--- a/lib_groups_getRankNameInGroup.js.html
+++ b/lib_groups_getRankNameInGroup.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_getRole.js.html b/lib_groups_getRole.js.html
index fc229ef0..af5d6f84 100644
--- a/lib_groups_getRole.js.html
+++ b/lib_groups_getRole.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_getRolePermissions.js.html b/lib_groups_getRolePermissions.js.html
index 4d8782f9..248d9315 100644
--- a/lib_groups_getRolePermissions.js.html
+++ b/lib_groups_getRolePermissions.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_getRoles.js.html b/lib_groups_getRoles.js.html
index b127a387..a577a9cc 100644
--- a/lib_groups_getRoles.js.html
+++ b/lib_groups_getRoles.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_getShout.js.html b/lib_groups_getShout.js.html
index a5b1ebff..c2430bc1 100644
--- a/lib_groups_getShout.js.html
+++ b/lib_groups_getShout.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_getWall.js.html b/lib_groups_getWall.js.html
index f6917ff7..7d7cc740 100644
--- a/lib_groups_getWall.js.html
+++ b/lib_groups_getWall.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_groupPayout.js.html b/lib_groups_groupPayout.js.html
index 27e60a4d..7d83cc92 100644
--- a/lib_groups_groupPayout.js.html
+++ b/lib_groups_groupPayout.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_handleJoinRequest.js.html b/lib_groups_handleJoinRequest.js.html
index c63df3d8..b6478e4f 100644
--- a/lib_groups_handleJoinRequest.js.html
+++ b/lib_groups_handleJoinRequest.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_leaveGroup.js.html b/lib_groups_leaveGroup.js.html
index ab086b0e..fa83fdd1 100644
--- a/lib_groups_leaveGroup.js.html
+++ b/lib_groups_leaveGroup.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_onAuditLog.js.html b/lib_groups_onAuditLog.js.html
index 3779ea94..31e662eb 100644
--- a/lib_groups_onAuditLog.js.html
+++ b/lib_groups_onAuditLog.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_onJoinRequest.js.html b/lib_groups_onJoinRequest.js.html
index 5ecff64b..f4f1532a 100644
--- a/lib_groups_onJoinRequest.js.html
+++ b/lib_groups_onJoinRequest.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_onJoinRequestHandle.js.html b/lib_groups_onJoinRequestHandle.js.html
index e1a0378b..04b8cdbf 100644
--- a/lib_groups_onJoinRequestHandle.js.html
+++ b/lib_groups_onJoinRequestHandle.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_onShout.js.html b/lib_groups_onShout.js.html
index aad8e0ba..4e17c96f 100644
--- a/lib_groups_onShout.js.html
+++ b/lib_groups_onShout.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_onWallPost.js.html b/lib_groups_onWallPost.js.html
index 08b365ce..163202c8 100644
--- a/lib_groups_onWallPost.js.html
+++ b/lib_groups_onWallPost.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_promote.js.html b/lib_groups_promote.js.html
index 9ffae1f0..54dfe0c6 100644
--- a/lib_groups_promote.js.html
+++ b/lib_groups_promote.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_searchGroups.js.html b/lib_groups_searchGroups.js.html
index 6b4437fe..bf8a73d5 100644
--- a/lib_groups_searchGroups.js.html
+++ b/lib_groups_searchGroups.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_setGroupDescription.js.html b/lib_groups_setGroupDescription.js.html
index 62dfdf80..76fdf1b3 100644
--- a/lib_groups_setGroupDescription.js.html
+++ b/lib_groups_setGroupDescription.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_setGroupName.js.html b/lib_groups_setGroupName.js.html
index 7a845910..f694543d 100644
--- a/lib_groups_setGroupName.js.html
+++ b/lib_groups_setGroupName.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_setRank.js.html b/lib_groups_setRank.js.html
index b087b0c4..68c3c5c9 100644
--- a/lib_groups_setRank.js.html
+++ b/lib_groups_setRank.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_groups_shout.js.html b/lib_groups_shout.js.html
index aeeefd49..d99f614f 100644
--- a/lib_groups_shout.js.html
+++ b/lib_groups_shout.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_internal_timeout.js.html b/lib_internal_timeout.js.html
index 37cecaea..44ff5ce4 100644
--- a/lib_internal_timeout.js.html
+++ b/lib_internal_timeout.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_inventory_getCollectibles.js.html b/lib_inventory_getCollectibles.js.html
index c71e24ad..c40f6cb0 100644
--- a/lib_inventory_getCollectibles.js.html
+++ b/lib_inventory_getCollectibles.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_inventory_getInventory.js.html b/lib_inventory_getInventory.js.html
index 9059c11a..ca43cb03 100644
--- a/lib_inventory_getInventory.js.html
+++ b/lib_inventory_getInventory.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_inventory_getInventoryById.js.html b/lib_inventory_getInventoryById.js.html
index af7704cd..01464d96 100644
--- a/lib_inventory_getInventoryById.js.html
+++ b/lib_inventory_getInventoryById.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_inventory_getOwnership.js.html b/lib_inventory_getOwnership.js.html
index cf21f7eb..a9f1cf32 100644
--- a/lib_inventory_getOwnership.js.html
+++ b/lib_inventory_getOwnership.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_inventory_getUAIDs.js.html b/lib_inventory_getUAIDs.js.html
index 386e9547..bf761b41 100644
--- a/lib_inventory_getUAIDs.js.html
+++ b/lib_inventory_getUAIDs.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_itemconfiguration_getGroupAssets.js.html b/lib_itemconfiguration_getGroupAssets.js.html
index d5cb79a1..87dd48c6 100644
--- a/lib_itemconfiguration_getGroupAssets.js.html
+++ b/lib_itemconfiguration_getGroupAssets.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_party_onPartyDeleted.js.html b/lib_party_onPartyDeleted.js.html
index d82e9bc5..817c81c2 100644
--- a/lib_party_onPartyDeleted.js.html
+++ b/lib_party_onPartyDeleted.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_party_onPartyInvite.js.html b/lib_party_onPartyInvite.js.html
index e6a66513..4c39ef2b 100644
--- a/lib_party_onPartyInvite.js.html
+++ b/lib_party_onPartyInvite.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_party_onPartyJoinedGame.js.html b/lib_party_onPartyJoinedGame.js.html
index 798f216a..54f2b108 100644
--- a/lib_party_onPartyJoinedGame.js.html
+++ b/lib_party_onPartyJoinedGame.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_party_onPartyLeftGame.js.html b/lib_party_onPartyLeftGame.js.html
index 8dd9b78f..37b3d76d 100644
--- a/lib_party_onPartyLeftGame.js.html
+++ b/lib_party_onPartyLeftGame.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_party_onPartySelfJoined.js.html b/lib_party_onPartySelfJoined.js.html
index e3e33ea0..3cdd769f 100644
--- a/lib_party_onPartySelfJoined.js.html
+++ b/lib_party_onPartySelfJoined.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_party_onPartySelfLeft.js.html b/lib_party_onPartySelfLeft.js.html
index e457c69d..4397f44d 100644
--- a/lib_party_onPartySelfLeft.js.html
+++ b/lib_party_onPartySelfLeft.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_party_onPartyUserJoined.js.html b/lib_party_onPartyUserJoined.js.html
index 0b0df57d..833e0277 100644
--- a/lib_party_onPartyUserJoined.js.html
+++ b/lib_party_onPartyUserJoined.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_party_onPartyUserLeft.js.html b/lib_party_onPartyUserLeft.js.html
index a33a3a8d..74ea64db 100644
--- a/lib_party_onPartyUserLeft.js.html
+++ b/lib_party_onPartyUserLeft.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_premiumfeatures_getPremium.js.html b/lib_premiumfeatures_getPremium.js.html
index 927e8b71..a129de53 100644
--- a/lib_premiumfeatures_getPremium.js.html
+++ b/lib_premiumfeatures_getPremium.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_presence_getPresences.js.html b/lib_presence_getPresences.js.html
index a0938c6c..2a6765ac 100644
--- a/lib_presence_getPresences.js.html
+++ b/lib_presence_getPresences.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_privatemessages_getMessages.js.html b/lib_privatemessages_getMessages.js.html
index 60b0e0a1..3e7f4cba 100644
--- a/lib_privatemessages_getMessages.js.html
+++ b/lib_privatemessages_getMessages.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_privatemessages_message.js.html b/lib_privatemessages_message.js.html
index 0bcd97c9..870b5393 100644
--- a/lib_privatemessages_message.js.html
+++ b/lib_privatemessages_message.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_privatemessages_onMessage.js.html b/lib_privatemessages_onMessage.js.html
index 13a0f6f8..68c5ef1e 100644
--- a/lib_privatemessages_onMessage.js.html
+++ b/lib_privatemessages_onMessage.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_thumbnails_getLogo.js.html b/lib_thumbnails_getLogo.js.html
index 0514fd09..d933755d 100644
--- a/lib_thumbnails_getLogo.js.html
+++ b/lib_thumbnails_getLogo.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_thumbnails_getPlayerThumbnail.js.html b/lib_thumbnails_getPlayerThumbnail.js.html
index 934a394d..a425914b 100644
--- a/lib_thumbnails_getPlayerThumbnail.js.html
+++ b/lib_thumbnails_getPlayerThumbnail.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_thumbnails_getThumbnails.js.html b/lib_thumbnails_getThumbnails.js.html
index 03bbb83c..e3c2c126 100644
--- a/lib_thumbnails_getThumbnails.js.html
+++ b/lib_thumbnails_getThumbnails.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_trades_acceptTrade.js.html b/lib_trades_acceptTrade.js.html
index fa6e68cb..c9c82f09 100644
--- a/lib_trades_acceptTrade.js.html
+++ b/lib_trades_acceptTrade.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_trades_canTradeWith.js.html b/lib_trades_canTradeWith.js.html
index b43de46d..f8a109b1 100644
--- a/lib_trades_canTradeWith.js.html
+++ b/lib_trades_canTradeWith.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_trades_counterTrade.js.html b/lib_trades_counterTrade.js.html
index 5b7ef8f2..0768ab98 100644
--- a/lib_trades_counterTrade.js.html
+++ b/lib_trades_counterTrade.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_trades_declineTrade.js.html b/lib_trades_declineTrade.js.html
index 48586c97..815ab544 100644
--- a/lib_trades_declineTrade.js.html
+++ b/lib_trades_declineTrade.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_trades_getTradeInfo.js.html b/lib_trades_getTradeInfo.js.html
index d2afcd15..e1ad1372 100644
--- a/lib_trades_getTradeInfo.js.html
+++ b/lib_trades_getTradeInfo.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_trades_getTrades.js.html b/lib_trades_getTrades.js.html
index 3978ccfa..b5c34715 100644
--- a/lib_trades_getTrades.js.html
+++ b/lib_trades_getTrades.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_trades_sendTrade.js.html b/lib_trades_sendTrade.js.html
index 1ce612f0..9bbbfbe3 100644
--- a/lib_trades_sendTrade.js.html
+++ b/lib_trades_sendTrade.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_users_getBlurb.js.html b/lib_users_getBlurb.js.html
index 489be19c..76888830 100644
--- a/lib_users_getBlurb.js.html
+++ b/lib_users_getBlurb.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_users_getIdFromUsername.js.html b/lib_users_getIdFromUsername.js.html
index 7876ada3..6df0bcaa 100644
--- a/lib_users_getIdFromUsername.js.html
+++ b/lib_users_getIdFromUsername.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_users_getPlayerInfo.js.html b/lib_users_getPlayerInfo.js.html
index c9527d06..add39c2b 100644
--- a/lib_users_getPlayerInfo.js.html
+++ b/lib_users_getPlayerInfo.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_users_getUsernameFromId.js.html b/lib_users_getUsernameFromId.js.html
index 8cc7449d..19f23822 100644
--- a/lib_users_getUsernameFromId.js.html
+++ b/lib_users_getUsernameFromId.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_users_onBlurbChange.js.html b/lib_users_onBlurbChange.js.html
index 67093a7b..db41b63d 100644
--- a/lib_users_onBlurbChange.js.html
+++ b/lib_users_onBlurbChange.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_clearSession.js.html b/lib_util_clearSession.js.html
index a2ecbf63..69768f2e 100644
--- a/lib_util_clearSession.js.html
+++ b/lib_util_clearSession.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_generalRequest.js.html b/lib_util_generalRequest.js.html
index 3dd97e3f..f74bc638 100644
--- a/lib_util_generalRequest.js.html
+++ b/lib_util_generalRequest.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_getAction.js.html b/lib_util_getAction.js.html
index 48bd6634..4cd6e691 100644
--- a/lib_util_getAction.js.html
+++ b/lib_util_getAction.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_getAuthenticatedUser.js.html b/lib_util_getAuthenticatedUser.js.html
index 6d3c0c63..d32009d9 100644
--- a/lib_util_getAuthenticatedUser.js.html
+++ b/lib_util_getAuthenticatedUser.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_getCurrentUser.js.html b/lib_util_getCurrentUser.js.html
index d60e7f7f..56268eb3 100644
--- a/lib_util_getCurrentUser.js.html
+++ b/lib_util_getCurrentUser.js.html
@@ -129,7 +129,7 @@
@@ -147,9 +147,10 @@
+ lib/util/getCurrentUser.js
// Includes
-const http = require('./http.js').func
+const settings = require('../../settings.json')
+
+const noblox = require('../index.js')
-// Args
exports.optional = ['option', 'jar']
// Docs
@@ -160,6 +161,7 @@ lib/util/getCurrentUser.js
* @param {string=} option - A specific option to return.
* @returns {LoggedInUserData}
* @example const noblox = require("noblox.js")
+ * @deprecated getCurrentUser() is deprecated; see getAuthenticatedUser(), getPremium(), getThumbnails(), getUserFunds() instead | August 27, 2024 - https://devforum.roblox.com/t/official-list-of-deprecated-web-endpoints/62889/66
* // Login using your cookie.
* const user = await noblox.getCurrentUser()
**/
@@ -168,23 +170,35 @@ lib/util/getCurrentUser.js
exports.func = async function (args) {
const jar = args.jar
const option = args.option
- const httpOpt = {
- url: '//www.roblox.com/mobileapi/userinfo',
- options: {
- resolveWithFullResponse: true,
- method: 'GET',
- followRedirect: true,
- jar
- }
+ if (settings.show_deprecation_warnings) {
+ console.warn('[DEPRECATED]: getCurrentUser() is deprecated by Roblox; use getAuthenticatedUser(), getPremium(), getThumbnails(), or getUserFunds() instead!')
+ console.warn(' > Opt out of these warnings using noblox.setOptions({ show_deprecation_warnings: false })')
}
- const res = await http(httpOpt)
- if (res.statusCode !== 200) {
- throw new Error('You are not logged in.')
+
+ const currentUser = await noblox.getAuthenticatedUser(jar)
+ const [premiumStatus, thumbnailResponse, robuxBalance] = await Promise.all(
+ [
+ noblox.getPremium(currentUser.id, jar),
+ noblox.getPlayerThumbnail(currentUser.id, '352x352', 'png', false, 'Body', jar),
+ noblox.getUserFunds(currentUser.id, jar)
+ ]
+ )
+
+ const json = {
+ UserID: currentUser.id,
+ UserName: currentUser.name,
+ RobuxBalance: robuxBalance,
+ ThumbnailUrl: thumbnailResponse[0].imageUrl,
+ IsAnyBuildersClubMember: false,
+ IsPremium: premiumStatus,
+ DEPRECATION_WARNING: '[DEPRECATED]: noblox.getCurrentUser() is deprecated; use getAuthenticatedUser(), getPremium(), getThumbnails(), or getUserFunds() instead!'
}
- const json = JSON.parse(res.body)
+
if (!option) {
return json
}
+
+ // Support queried rgequests `getCurrentUser('UserID') -> only UserID`
const searchKey = Object.keys(json).filter((key) => {
return option.toLowerCase() === key.toLowerCase()
})[0]
diff --git a/lib_util_getGeneralToken.js.html b/lib_util_getGeneralToken.js.html
index 82075aa2..fd3bcbff 100644
--- a/lib_util_getGeneralToken.js.html
+++ b/lib_util_getGeneralToken.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_getHash.js.html b/lib_util_getHash.js.html
index a2f56c4c..967b2d83 100644
--- a/lib_util_getHash.js.html
+++ b/lib_util_getHash.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_getInputs.js.html b/lib_util_getInputs.js.html
index 79c423aa..b3462717 100644
--- a/lib_util_getInputs.js.html
+++ b/lib_util_getInputs.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_getPageResults.js.html b/lib_util_getPageResults.js.html
index e6aedd07..0fe26b35 100644
--- a/lib_util_getPageResults.js.html
+++ b/lib_util_getPageResults.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_getSenderUserId.js.html b/lib_util_getSenderUserId.js.html
index a36245e9..80c4f877 100644
--- a/lib_util_getSenderUserId.js.html
+++ b/lib_util_getSenderUserId.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_getSession.js.html b/lib_util_getSession.js.html
index 45d10e47..8517dac2 100644
--- a/lib_util_getSession.js.html
+++ b/lib_util_getSession.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_getVerification.js.html b/lib_util_getVerification.js.html
index 7315672d..a69ccc31 100644
--- a/lib_util_getVerification.js.html
+++ b/lib_util_getVerification.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_getVerificationInputs.js.html b/lib_util_getVerificationInputs.js.html
index 48c4d871..d16c2740 100644
--- a/lib_util_getVerificationInputs.js.html
+++ b/lib_util_getVerificationInputs.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_http.js.html b/lib_util_http.js.html
index 4f8cebe8..12fd31f9 100644
--- a/lib_util_http.js.html
+++ b/lib_util_http.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_jar.js.html b/lib_util_jar.js.html
index 34032458..7212555c 100644
--- a/lib_util_jar.js.html
+++ b/lib_util_jar.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_refreshCookie.js.html b/lib_util_refreshCookie.js.html
index 33d5c556..80876c4d 100644
--- a/lib_util_refreshCookie.js.html
+++ b/lib_util_refreshCookie.js.html
@@ -129,7 +129,7 @@
diff --git a/lib_util_setOptions.js.html b/lib_util_setOptions.js.html
index 65dd7d69..0653cce0 100644
--- a/lib_util_setOptions.js.html
+++ b/lib_util_setOptions.js.html
@@ -129,7 +129,7 @@
@@ -154,7 +154,7 @@ lib/util/setOptions.js
* altering the settings.json file. Objects passed to this function should match the format of the settings.json file.
* Unknown keys, or malformed options will be rejected with an error.
* @category Utility
- * @param {NobloxOptions} newOptions - The new options to set, structured as per [settings.json](https://github.com/noblox/noblox.js/blob/master/settings.json)
+ * @param {Partial<NobloxOptions>} newOptions - The new options to set, structured as per [settings.json](https://github.com/noblox/noblox.js/blob/master/settings.json)
* @returns void
* @see [settings.json](https://github.com/noblox/noblox.js/blob/master/settings.json) - default package settings
* @example const noblox = require("noblox.js")
diff --git a/lib_util_shortPoll.js.html b/lib_util_shortPoll.js.html
index d0e2492f..dc67f35d 100644
--- a/lib_util_shortPoll.js.html
+++ b/lib_util_shortPoll.js.html
@@ -129,7 +129,7 @@
diff --git a/typings_jsDocs.ts.html b/typings_jsDocs.ts.html
index 1ca764ce..f9de930a 100644
--- a/typings_jsDocs.ts.html
+++ b/typings_jsDocs.ts.html
@@ -129,7 +129,7 @@
@@ -162,6 +162,9 @@ typings/jsDocs.ts
* NobloxOptions for setOptions, based from settings.json
*/
type NobloxOptions = {
+ /** Prints console warnings for functions that are being polyfilled by newer methods due to upstream Roblox API changes */
+ show_deprecation_warnings: boolean;
+
/** Minimizes data usage and speed up requests by only saving session cookies, disable if you need other cookies to be saved as well. (Default: true) */
session_only: boolean;
@@ -1522,9 +1525,8 @@ typings/jsDocs.ts
UserID: number,
UserName: string,
RobuxBalance: number,
- TicketsBalance: number,
ThumbnailUrl: string,
- IsAnyBuildersClubMember: boolean,
+ IsAnyBuildersClubMember: false,
IsPremium: boolean
}