Friends

This page has methods that include things like friends and followers. The page below introduces you to "promises" which is what is used to handle success and errors with the API.

Introduction to Promises

countFriends

This method counts the friends for a specified user.

Sample code: (provides the friend count of the Roblox account)

client.friends:countFriends(1):andThen(function(count)
    print(count)
end):catch(warn)

Arguments:

Type
Name

integer

userId

Returns: <integer>

getFollowers

This methods gets the followers of a specified user in a page format. If you do not know how to use pages, you can check it out at the page below.

Introduction to Pages

Sample code: (gets the followers of me)

client.friends:getFollowers(87424828):andThen(function(pageObject)
    print(pageObject:getCurrentPage());
end):catch(warn)

Arguments:

Type
Name

integer

userId

Returns: <array> (page object)

getFollowings

This method gets the people the specified user is following in a page format. If you don't know how to use pages, here's the rundown:

Introduction to Pages

Sample code: (gets the people I'm following) (nobody lol)

client.friends:getFollowings(87424828):andThen(function(pageObject)
    print(pageObject:getCurrentPage());
end):catch(warn)

Arguments:

Type
Name

integer

userId

Returns: <array> (page object)

countFriendRequests

This counts the friend requests for the current authenticated user.

Sample code:

client.friends:countFriendRequests():andThen(function(number)
    print(number)
end):catch(warn)

This function requires no arguments.

Returns: <integer>

getFriends

This method returns the friends of a specified user in an array format.

Sample code:

client.friends:getFriends(87424828):andThen(function(friends)
    print(friends)
end):catch(warn)

Arguments:

Type
Name

integer

userId

Returns: <array> Example:

{
    {
        ["created"] = "0001-01-01T06:00:00Z",
        ["displayName"] = "k9gal18",
        ["friendFrequentRank"] = 1,
        ["id"] = 13140528,
        ["isBanned"] = false,
        ["isDeleted"] = false,
        ["isOnline"] = false,
        ["name"] = "k9gal18",
        ["presenceType"] = 0
    },
}

Last updated