-
Notifications
You must be signed in to change notification settings - Fork 140
User Functions
-
Users
-
User Gets
-
User Events
Accepts friend requests from userId
.
Arguments
- userId (number)
- optional jar (CookieJar)
Returns
(Promise)
Blocks the user with userId
.
Arguments
- userId (number)
- optional jar (CookieJar)
Returns
(Promise)
Declines friend requests from userId
.
Arguments
- userId (number)
- optional jar (CookieJar)
Returns
(Promise)
Follows the user with userId
.
Arguments
- userId (number)
- optional jar (CookieJar)
Returns
(Promise)
Logs into username
with password
and stores their cookie in jar
.
Arguments
- username (string)
- password (string)
- optional jar (CookieJar)
Returns
(Promise)
- userInfo (Object)
- userId (number)
Sends a message with body
and subject
to the user with id recipient
.
Arguments
- recipient (number)
- subject (string)
- body (string)
- optional jar (CookieJar)
Returns
(Promise)
Removes friends with userId
.
Arguments
- userId (number)
- optional jar (CookieJar)
Returns
(Promise)
Sends a friend request to userId
.
Arguments
- userId (number)
- optional jar (CookieJar)
Returns
(Promise)
Unblocks the user with userId
.
Arguments
- userId (number)
- optional jar (CookieJar)
Returns
(Promise)
Unfollows the user with userId
.
Arguments
- userId (number)
- optional jar (CookieJar)
Returns
(Promise)
Gets the blurb
of the user with the ID userId
.
Arguments
- userId (number)
Returns
(Promise)
- blurb (string)
Gets the friend list of userId
where type
is AllFriends
, Following
, Followers
, or FriendRequests
. The page
parameter can be a number or array of numbers specifying what pages to get. Note that pages are in groups of 200 friends. If you need to be more precise use limit. As usual page
can be negative to specify trailing pages. If limit
is specified a maximum of that many friends are retrieved.
You do not have to be logged in to get friends however if you want to get friend requests you have to and if you want to see what games your friends are in you may have to be logged in as the permission is often limited to friends.
Friends are returned in the order they appear on the normal list.
Arguments
- userId (number)
- type (string)
- optional page (number/Array)
- optional limit (number)
- optional jar (CookieJar)
Returns
(Promise)
- list (Object)
- friends (Array)
- friend (Object)
- user (Object)
- id (number)
- name (string)
- avatar (Object)
- url (string)
- final (boolean)
- Whether or not this is the final avatar. This will be false if it is moderated or is still loading.
- status (Object)
- online (boolean)
- lastSeen (Date)
- parent (Object)
- page (number)
- index (number)
- fullIndex (number)
- inGame (boolean)
- inStudio (boolean)
- following (boolean)
- deleted (boolean)
- user (Object)
- friend (Object)
- totalPages (number)
- total (number)
- friends (Array)
Gets the id
of user with username
and caches according to settings.
Arguments
- username (string)
Returns
(Promise)
- id (number)
Gets messages in the inbox of player with jar
. If page
does not exist the entire inbox will be indexed, otherwise it will only do the specific page or a specific number of pages in an array. Similar to getForumPost, negative numbers can be used to get pages of the inbox starting from the end. Note that even though ROBLOX internally begins pages at 0, if you pass a page into this function it will automatically be adjusted. So the first page of the inbox is page 1 and not page 0.
If limit
is defined that is the maximum number of messages that will be returned. Regardless of how many pages are specified, the function will automatically cut down request sizes to meet it. For example, if you do not specify a page number but enter in a limit of 30, the function will only get the first page and half of the second page (each page has 20 messages).
The tab
option specifies which part of messages to index where 0
is the inbox, 1
is sent messages, and 3
is archived messages.
An object is returned with the thread's posts in the posts
array, they are in order from newest to oldest. For example, to get your latest message:
rbx.getMessages(1, 1).then(function (inbox) {
console.log(inbox.messages[0]);
});
Arguments
- optional page (number/Array)
- optional limit (number)
- optional tab (number)
- optional jar (CookieJar)
Returns
(Promise)
- inbox (Object)
- messages (Array)
- message (Object)
- sender (Object)
- userId (number)
- name (string)
- subject (string)
- body (string)
- created (Date)
- updated (Date)
- read (boolean)
- parent (Object)
- page (number)
- id (number)
- sender (Object)
- message (Object)
- totalPages (number)
- total (number)
- messages (Array)
Gets the status
message of the user with the ID userId
.
Arguments
- userId (number)
Returns
(Promise)
- status (string)
Gets username
of user with id
and caches according to settings.
Arguments
- id (number)
Returns
(Promise)
- username (string)
Fires when new friend requests are received.
Arguments
- optional jar (CookieJar)
Returns
(EventEmitter)
- data
- userId (number)
Fires whenever a new message is received. Because it relies on onNotification
, the logged in user's notification stream for messages must be enabled; however, it is one of the true events and does not rely on short polling.
Arguments
- optional jar (CookieJar)
Returns
(EventEmitter)
- data
- message (Object)
- sender (Object)
- userId (number)
- name (string)
- subject (string)
- body (string)
- created (Date)
- updated (Date)
- read (boolean)
- parent (Object)
- page (number)
- id (number)
- sender (Object)
- message (Object)
This is one of the only true streams, using web sockets to connect to ROBLOX's notification system. The logged in user must have relevant notifications enabled in their settings in order to receive notifications through this (of course). All notifications haven't been mapped out but what is known is that they all have a name
and message
(separate arguments to the data
event), where message
is an object that includes a field type
.
For example, a new message notification would be detected as so:
var notifications = rbx.onNotification();
notifications.on('data', function (name, message) {
if (name === 'NotificationStream' && message.Type === 'NewNotification') {
// A new message was received, retrieve the inbox to read it.
}
});
Arguments
- optional jar (CookieJar)
Returns
(EventEmitter)
- data
- name (String)
- message (Object)
- type (String)
This wiki is currently outdated. It will be kept for reference purposes. It is highly recommended you visit https://noblox.js.org instead to see the latest documentation.