Top Banner
roblox.py Documentation Release 0.1.8a2 Patrick Dill Feb 04, 2018
31

Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

Oct 25, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py DocumentationRelease 0.1.8a2

Patrick Dill

Feb 04, 2018

Page 2: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,
Page 3: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

Contents:

1 API Reference 11.1 Client Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Roblox Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.2.1 User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.2.2 Asset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.2.3 Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1.3 Data Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111.3.1 Enums . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

1.4 Site Chat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.5 Utils . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2 Changelog 192.1 0.1.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.2 0.1.7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.3 0.1.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.4 0.1.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.5 0.1.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202.6 0.1.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202.7 0.0.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202.8 0.0.6a5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202.9 0.0.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202.10 0.0.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3 Getting Started 23

i

Page 4: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

ii

Page 5: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

CHAPTER 1

API Reference

1.1 Client Session

class roblox.RobloxSession(username=None, password=None, proxies=None,check_login=False)

The RobloxSession, often referred to in these docs as the Client, is the interface between the program andRoblox. Everything should be accessed from the RobloxSession, including users, assets, and groups, instead ofdirectly creating those objects.

Parameters

• username (str) – Keyword username to login with. This is not required. If no username& password are given, you can use login() after the session is created.

• password (str) – Keyword password to login with. Same applies as above.

• proxies (dict) – Keyword argument telling the session what proxy to use. The proxiesshould contain the schema.

• check_login (bool) – Keyword argument. If True, the session will be verified everytime a function is used that requires login, with logged_in() . Defaults to False

Proxy example:

proxies = {'http': 'http://host:port','https': 'https://host:port',

}

roblox.py also natively supports the SOCKS protocol.

proxies = { ‘http’: ‘socks5://host:port’, ‘https’: ‘socks5://host:port’

}

Or, with auth:

1

Page 6: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

proxies = {'http': 'socks5://user:pass@host:port','https': 'socks5://user:pass@host:port'

}

In case you use proxies that may go down, you can change the proxy at any time by changingRobloxSession.http.proxies

This class can also be used as a context manager, if you provide username and password on init.

with roblox.RobloxSession(username="iLoveBricks", password="rawrXD123") as rbx:→˓# create session as rbx

rbx.post_status("i love bricks!") # post status

# session is automatically invalidated once the block is complete

usernameOptional[str] – Username of logged in user

passwordOptional[str] – Password of logged in user

user_idOptional[int] – ID of logged in user

meOptional[User] – User object for logged in user

chatRobloxChatManager – Chat object, allows communication on roblox site

logged_inIf keyword check_login is True, this will check if the client is still logged in. Otherwise, it will justreturn whether the client has used login()

login(username: str, password: str)Logs the session into Roblox with given info.

Parameters

• username (str) – Username to login with

• password (str) – Password to login with

Raises LoginException – if login failed. Could be for several reasons

Returns True if login successful

logout()Logs out of the signed in account.

Resets username, user_id, and user attributes.

create_account(username, password, birthday, gender)Creates a new Roblox account with the username and password given.

Parameters

• username (str) – Username

• password (str) – Password

• birthday (datetime.date or datetime.datetime) – Birthday to sign up with

2 Chapter 1. API Reference

Page 7: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

• gender (roblox.Gender) – Gender

Returns True if successful

verify_session()Checks if client session is still logged in.

Returns True if session is logged in.

get_self()Returns updated class:User for the logged in user.

Returns User

is_username_taken(username)Checks if username is taken.

Returns boolean

get_user(username=None, user_id=None)Gets user by username or user id.

Keyword Arguments

• username (str) – Username

• user_id (str) – User ID

Returns User

get_asset(asset_id)Gets asset object by its asset id

Parameters asset_id (int) – Asset ID to get asset from.

Returns Asset

get_group(group_id)Gets group by its group id (the one in the URL)

Parameters group_id (int) – Group ID to get group from.

Returns Group

robux()Gets amount of ROBUX the client user has.

Returns int

unread_message_count()Gets client user’s unread message count.

Returns int

friend_request_count()Gets client user’s incoming friend request count.

Returns int

block(user)Blocks other user, preventing any direct communication.

Parameters user (User) – User to block

Returns True if successful.

unblock(user)Unlocks other user

1.1. Client Session 3

Page 8: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

Parameters user (User) – User to unblock

Returns True if successful.

post_status(status)Updates user status

Parameters status (str) – New status to set

Returns True if successful

set_blurb(blurb)Sets profile’s blurb/decsription

Parameters blurb (str) – Blurb to set

Returns True if successful

set_description(description)Alias for RobloxSession.set_blurb()

friend_requests()Generator yielding FriendRequest

Returns FriendRequest

send_friend_request(user)Sends friend request to other user.

Parameters user (User) – User to send to friend request to.

Returns Friend request that was sent.

Return type FriendRequest

accept_friend_request(user)Accepts friend request from user

Parameters user (User) – User to accept friend request from.

Returns True if successful

decline_friend_request(user)Declines friend request from user

Parameters user (User) – User to decline friend request from.

Returns True if successful

unfriend(user)Unfriends user

Parameters user (User) – User to unfriend

Returns True if successful

follow_user(user)Follows other user

Parameters user (User) – User to follow

Returns True if successful

unfollow_user(user)Unfollows user

Parameters user (User) – User to unfollow

4 Chapter 1. API Reference

Page 9: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

Returns True if successful

send_private_message(user, subject: str, body: str)Sends private message

Parameters

• user (User) – User to send message to

• subject (str) – Message subject

• body (str) – Message body

Returns PrivateMessage if successful

private_messages(inbox=0)Generator yielding private messages in inbox

Parameters inbox (roblox.MessageInbox) – Inbox tab to get

Returns PrivateMessage

leave_group(group)Leaves group.

Parameters group (Group) – Group to leave

Returns True if successful

join_group(group)Joins group.

Parameters group (Group) – Group to join

Returns True if successful

get_presences(*users)Gets UserPresence for each user

Parameters users (User) – Users to get presences from

Returns List[UserPresence]

friendship(*args, **kwargs)Gets Friendship between two users if they are friends. Returns None if the friendship doesn’t exist.

Parameters

• user0 (User) –

• user1 (User) –

Returns Optional[Friendship]

1.2 Roblox Objects

Don’t create any instances of these directly. Instead, get them from the RobloxSession object.

• RobloxSession.get_user()

• RobloxSession.get_asset()

• RobloxSession.get_group()

1.2. Roblox Objects 5

Page 10: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

1.2.1 User

class roblox.User(client, user_id=None, username=None)Object representing a ROBLOX user.

Use RobloxSession.get_user() to get a specific user.

usernamestr – Username

idint – User ID

absolute_urlstr – URL to user’s profile

primary_groupUser’s primary group

Returns Group

membershipGet what membership the user has (or NBC)

Returns enums.BuildersClubStatus

join_datedatetime for when the user joined Roblox.

Returns datetime.datetime

place_visitsPlace visits across every place by user

Returns int

forum_post_countNumber of users’s forum posts

Returns int

groups()Generator yielding groups the user is in

Returns Group

friend_countNumber of friends user has

friendships()Generator yielding user’s friends

Returns Friendship

can_manage(asset)Checks if user can manage an asset

Parameters asset (Asset) – Asset to check

Returns True if can manage.

has_asset(asset)Checks if user owns asset

Parameters asset (Asset) – Asset to check

6 Chapter 1. API Reference

Page 11: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

Returns True if user has asset

presenceUser’s presence (UserPresence)

send_friend_request()Alias for RobloxSession.send_friend_request()

unfriend()Removes friendship between User and client

Returns True if successful

followers()Generator yielding followers

Returns User

followings()Generator yielding users this user is following

Returns User

follow()Follows user

Returns True if successful

unfollow()Unfollows user

Returns True if successful

friendship(user)Gets friendship with other user if it exists. None it doesn’t exist.

Parameters user (User) – User to check for friendship

Returns Optional[Friendship]

send_private_message(subject: str, body: str)Alias for RobloxSession.send_private_message()

block()Alias for RobloxSession.block()

unblock()Alias for RobloxSession.unblock()

get_status()Gets user’s status.

Returns Optional[str]

get_blurb()Gets user’s blurb/description

Returns Optional[str]

get_description()Alias for User.get_blurb()

inventory(asset_type=<AssetType.Shirt: 11>)Generator yielding items from user’s inventory.

1.2. Roblox Objects 7

Page 12: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

Parameters asset_type (enums.AssetType) – Keyword: asset type to get from inven-tory. Defaults to enums.AssetType.Shirt

1.2.2 Asset

class roblox.Asset(client, asset_id=0)Roblox Asset object.

Use RobloxSession.get_asset() to get a specific asset.

namestr – Asset name

descriptionstr – Asset description

idint – Asset ID

product_idOptional[int] – Product ID

asset_typeroblox.AssetType – Asset type

createddatetime.datetime – When the asset was first created

updateddatetime.datetime – When the asset was last updated

priceOptional[int] – Price of the asset in ROBUX

salesOptional[int] – Total sales of the asset

is_newbool – Whether Roblox considers the asset ‘new’

for_salebool – Whether asset can be taken/bought

public_domainbool – If the asset is public domain / publicly viewable

limitedbool – If the asset is limited

limited_uniquebool – If the asset is limited and unique

remainingOptional[int] – How many are remaining, if the asset is limited

membership_levelroblox.Membership – Minimum Builders Club needed to take the asset

creatorAsset creator

Returns User or Group

8 Chapter 1. API Reference

Page 13: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

buy()Takes/buys asset.

Returns True if successful

remove_from_inventory()Deletes asset from inventory of client user.

Returns True if successful

post_comment(content)Posts comment on asset

Parameters content (str) – Comment text

Returns Comment

owned_by(user)Checks if asset is owned by user.

Parameters user (User) – User

Returns True if user owns asset

iconAsset for icon

Returns Optional[Asset]

favoritesFavorite count of asset

Returns int

is_favorited()Whether asset is favorited by client

Returns bool

favorite()Favorites asset if it isn’t favorited already.

Returns return value of is_favorited() (bool)

unfavorite()Unfavorites asset if it’s favorited.

Returns return value of is_favorited() (bool)

recent_average_price()Gets RAP of asset, if it is a collectible.

Returns Optional[int]

RAP()Alias for :meth:recent_average_pice

sales_chart()Gets SalesChart for asset, if it’s a collectible.

1.2.3 Group

class roblox.Group(client, group_id=0)Group Object.

1.2. Roblox Objects 9

Page 14: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

Use RobloxSession.get_group() to get a specific group.

namestr – Group name

descriptionstr – Group description

idint – Group ID (in URL)

rolesList[GroupRoleSet] – List of group’s RoleSets

ownerGroup’s owner, if any.

Returns Optional[User]

emblemGroup emblem asset.

Returns Asset

role_of(user)Gets role of User in group. None if the user isn’t in the group.

Parameters user (User) – User to get role of

Returns Optional[GroupRoleSet]

my_roleRole of client user in group. None if the user isn’t in the group.

Returns Optional[GroupRoleSet]

group_fundsGets group funds, if they are visible to the logged in user. If group funds aren’t visible, returns None

Returns Optional[int]

member_countNumber of members in group

Returns int

get_shout()Group’s current shout (text in yellow box.)

Returns Optional[GroupShout]

post_shout(shout)Posts to group shout if logged in user has permission.

Parameters shout (str) – Shout to post

Returns Optional[GroupShout]

leave()Alias for RobloxSession.leave_group()

join()Alias for RobloxSession.join_group()

10 Chapter 1. API Reference

Page 15: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

1.3 Data Classes

Don’t create any instances of these directly. Instead, get them from the RobloxSession or their respective objects

class roblox.SalesChart(client, asset)Asset sales chart, representing user sales of a collectible.

You can also iterate over this object, and index it. SalesChart[0] will return the first sales point. You canalso use

>>> list(chart)>>> reversed(chart)>>> dict(chart)>>> len(chart)>>> datetime.date in chart

The dict version and list versions’ values are namedtuples representing sales points, with sales_point.date , sales_point.price , and sales_point.volume

The dict’s keys are datetime.date

assetAsset – Asset the sales chart belongs to

chart_dictdict – dict version of the sales chart

class roblox.PrivateMessage(client, subject=None, body=None, read=None, message_id=None,recipient=None, sender=None, created=None)

Private message object.

Note: RobloxSession.send_private_message() and User.send_private_message() givemessage objects with very minimal information.

It is recommended to use RobloxSession.private_messages() to get info about a message.

TODO: Message Replies

subjectstr – Message subject

bodystr – Message body

createdOptional[datetime.datetime] – When the message was created/sent

readOptional[bool] – Whether the message is marked as read

idOptional[int] – Specific Message ID

recipientMessage recipient

Returns Optional[User]

senderMessage sender

Returns Optional[User]

1.3. Data Classes 11

Page 16: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

archive()Moves message to archive tab of inbox

Returns bool (success)

mark_read()Marks message as read

Returns bool (success)

mark_unread()Marks message as unread

Returns bool (success)

class roblox.UserPresence(client, user=None, **kwargs)User presence object

userUser – User the presence object is for

user_presenceroblox.UserPresenceType – User’s presence type

absolute_place_urlOptional[str] – URL to place the user is at, if any

place_idOptional[int] – ID of the place the user is at, if any

location_strstr – String representing the user location. Usually 'Online' or 'Offline'

as_ofdatetime.datetime – Datetime of when this presence was updated

class roblox.UserRelationship(client, user0, user1)User Relationship base class

user0returns – User

user1returns – User

class roblox.Friendship(client, user0, user1)Inherits from UserRelationship

Represents a friendship between two users

remove()Removes friendship if one of the users is the session user

Returns True if successful

class roblox.FriendRequest(client, user0, user1)Inherits from UserRelationship

Friend Request object

senderFriend request sender

Returns User

12 Chapter 1. API Reference

Page 17: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

recipientFriend request recipient

Returns User

accept()Accepts friend request if the recipient is session user.

Returns True if successful

decline()Declines friend request if the recipient is session user.

Returns True if successful

class roblox.GroupRoleSet(group, **kwargs)Group RoleSet object.

groupGroup – Group the RoleSet belongs to

namestr – Name of the RoleSet

rankint – Rank of the RoleSet in the group

roleset_idint – Explicit RoleSet ID. This is used internally by the Roblox site

class roblox.GroupShout(group, content=None, created=None, author=None)Group Shout object

contentstr – Post content

createdOptional[datetime.datetime] – Time the post was made

authorUser who made the post.

Returns Optional[User]

class roblox.Comment(asset, content=None, created=None, author=None)Asset comment.

assetAsset – Asset the comment belongs to

contentstr – Comment content

createddatetime.datetime – When the comment was posted

authorUser who made the post.

Returns User

1.3. Data Classes 13

Page 18: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

1.3.1 Enums

class roblox.UserPresenceTypeSite presences that a user can have.

• Offline = 0

• Online = 1

• Playing = 2

class roblox.MessageInboxMessage inbox tabs

• Inbox = 0

• Sent = 1

• News = 2

• Archive = 3

class roblox.AssetTypeAsset type reference

class roblox.GenderGenders - there’s only two.

• Male = 2

• Female = 3

class roblox.ConversationTypeSite conversation types

• User = “OneToOneConversation”

• Multi = “MultiUserConversation”

1.4 Site Chat

roblox.py supports in depth interaction with the Roblox site chat.

class roblox.chat.RobloxChatManager(client)Class with Roblox Chat functions. Access this via roblox.RobloxSession.chat

enabled(*args, **kwargs)Gets whether chat is enabled (privacy setting)

Returns bool

get_conversation(conversation_id)Gets conversation by id

Parameters conversation_id (int) – Id

Returns Conversation

conversations()Gets list of conversations the user has with others

Returns list[Conversation, MultiUserConversation]

14 Chapter 1. API Reference

Page 19: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

multi_user_conversations()Returns all mutli user conversations

Returns list[MultiUserConversation]

one_to_one_conversations()Returns all one to one conversations

Returns list[Conversation]

unread_conversation_count()Gets number of conversations with unread messages

Returns int

unread_conversations()Gets list of conversations with unread messages.

Returns List[Conversation]

start_conversation(*users)Starts conversation with user(s). Returns existing conversation if it already exists.

Parameters users (roblox.User) – User to start conversation with

Returns Conversation or MultiUserConversation

class roblox.chat.Conversation(client, model)Conversation object for roblox’s site chat.

Conversations can be indexed and iterated over. You can also test if a user or a message is in a conversation within

idstr – Conversation Id, used internally

titlestr – Conversation title

typeroblox.enums.ConversationType – Type of conversation

last_updateddatetime.datetime – Last time the conversation was updated in any form

participantsConversation participants

Returns List[roblox.User]

initiatorUser who started the conversation

Returns roblox.User

recent_messages(limit=10)Recent messages in a conversation.

Parameters limit (int) – Number of messages to fetch. Max 150

Returns List[Message]

send_message(content)Sends message to conversation

Parameters content – Message to send.

1.4. Site Chat 15

Page 20: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

Returns Message

unread_messages()Gets unread messages from conversation

Returns List[Message]

start_typing()Shows typing indicator in conversation.

You can also use the context manager to make things simpler. typing()

Returns status message

stop_typing()Hides typing indicator in conversation

Returns status message

typing()Context manager to make the typing indicator easy to use. It will hide the typing indicator when the blockis done.

Example:

with conversation.typing():text = this_function_takes_a_long_time()

conversation.send_message(text)

wait_for_message(timeout=15)Waits for message and returns the meesage.

Returns str

mark_as_seen()Marks messages in conversation as read.

Returns bool (success)

class roblox.chat.MultiUserConversation(client, model)Conversation with multiple users, inheriting from Conversation

rename(title)Renames group conversation

Parameters title (str) – New title

Returns Conversation title after change attempt

add_participants(*users)Adds users to the conversation.

Parameters users (roblox.User) – Users to add

remove_participant(user)Removes user from conversation

Parameters user (roblox.User) – User to remove

Returns bool (success)

class roblox.chat.Message(conversation, model)Message on the roblox site chat (different than a PM)

16 Chapter 1. API Reference

Page 21: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

conversationConversation – Conversation the message belongs to

iduuid.UUID – Message’s UUID

readOptional[bool] – Whether message has been read. Not present for messages returned byConversation.send_message()

senderUser who sent the message (property)

Returns User

1.5 Utils

roblox.utils.get(iterator, **kwargs)Finds an object in the given iterator with matching attributes to **kwargs

Keyword Arguments kwargs – Attributes to match

Returns Object found or None

roblox.utils.robux_parse(st)Converts Roblox format ROBUX strings to floats.

Example:

>>> robux_parse("93.6k")93600>>> robux_parse("21m")21000000>>> robux_parse("50")50

Parameters st (str) – String to parse

Returns int

1.5. Utils 17

Page 22: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

18 Chapter 1. API Reference

Page 23: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

CHAPTER 2

Changelog

2.1 0.1.8

• Continuing to make things more reliable with BeautifulSoup

• Working on fixing deprecated APIs

• Instead of having Asset.limited and Asset.limited_unique, where only one could be true, there is now As-set.limited and Asset.unique (if Asset.unique is True, so is Asset.limited)

• Asset.RAP()

• Fixed Asset.favorite(), Asset.unfavorite(), and Asset.is_favorited()

2.2 0.1.7

• Fixed several profile properties that were broken by Roblox updates

• Caching - but it actually works

2.3 0.1.4

• RobloxSession.friends() changed to RobloxSession.friendships()

• RobloxSession can now be used as a context manager

2.4 0.1.3

• Inventory listing with User.inventory()

19

Page 24: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

2.5 0.1.2

• Lots of new private message functions for manipulating inboxes

2.6 0.1.1

• Full Site Chat Support

• User.membership

• Group.owner

2.7 0.0.8

• Much better login checking, added keyword check_login for RobloxSession

• RobloxSession.remove_from_inventory instead of RobloxSession.delete_from_inventory

2.8 0.0.6a5

• Signups

• require_login decorator - don’t allow some functions if not logged in

• RobloxSession.logged_in

• Proxy support

• Account creation

• Streamlined exceptions

2.9 0.0.4

• Asset.favorites

• Asset.is_favorited()

• Asset.favorite()

• Asset.unfavorite()

• ImPoRtAnT: Changed User.user_id, Asset.asset_id, and Group.group_id to just id

• Group.member_count

• user stats: joined, place_visits, forum_post_count

20 Chapter 2. Changelog

Page 25: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

2.10 0.0.3

• Group leaving and joining (TODO: Make primary and remove primary)

roblox.py is the easiest to use Python library for the ROBLOX site.

It’s already capable of many things, supporting several features outside of the usual roblox api, but there’s a lot moreto come.

2.10. 0.0.3 21

Page 26: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

22 Chapter 2. Changelog

Page 27: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

CHAPTER 3

Getting Started

You can install the project with $ pip install roblox.py

An Example(tm)

import roblox

# I wanna let my friends know how much I love themwith roblox.RobloxSession(username="iLoveBricks", password="password123") as rbx:

for friendship in rbx.friendships():try:

convo = rbx.chat.start_conversation(friendship.user1)convo.send_message("ily! ~ iLoveBricks")

except roblox.errors.RobloxException:print("Couldn't send message to {}".format(friendship.user1))

23

Page 28: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

24 Chapter 3. Getting Started

Page 29: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

Index

Aabsolute_place_url (roblox.UserPresence attribute), 12absolute_url (roblox.User attribute), 6accept() (roblox.FriendRequest method), 13accept_friend_request() (roblox.RobloxSession method),

4add_participants() (roblox.chat.MultiUserConversation

method), 16archive() (roblox.PrivateMessage method), 11as_of (roblox.UserPresence attribute), 12Asset (class in roblox), 8asset (roblox.Comment attribute), 13asset (roblox.SalesChart attribute), 11asset_type (roblox.Asset attribute), 8AssetType (class in roblox), 14author (roblox.Comment attribute), 13author (roblox.GroupShout attribute), 13

Bblock() (roblox.RobloxSession method), 3block() (roblox.User method), 7body (roblox.PrivateMessage attribute), 11buy() (roblox.Asset method), 8

Ccan_manage() (roblox.User method), 6chart_dict (roblox.SalesChart attribute), 11chat (roblox.RobloxSession attribute), 2Comment (class in roblox), 13content (roblox.Comment attribute), 13content (roblox.GroupShout attribute), 13Conversation (class in roblox.chat), 15conversation (roblox.chat.Message attribute), 16conversations() (roblox.chat.RobloxChatManager

method), 14ConversationType (class in roblox), 14create_account() (roblox.RobloxSession method), 2created (roblox.Asset attribute), 8created (roblox.Comment attribute), 13

created (roblox.GroupShout attribute), 13created (roblox.PrivateMessage attribute), 11creator (roblox.Asset attribute), 8

Ddecline() (roblox.FriendRequest method), 13decline_friend_request() (roblox.RobloxSession

method), 4description (roblox.Asset attribute), 8description (roblox.Group attribute), 10

Eemblem (roblox.Group attribute), 10enabled() (roblox.chat.RobloxChatManager method), 14

Ffavorite() (roblox.Asset method), 9favorites (roblox.Asset attribute), 9follow() (roblox.User method), 7follow_user() (roblox.RobloxSession method), 4followers() (roblox.User method), 7followings() (roblox.User method), 7for_sale (roblox.Asset attribute), 8forum_post_count (roblox.User attribute), 6friend_count (roblox.User attribute), 6friend_request_count() (roblox.RobloxSession method),

3friend_requests() (roblox.RobloxSession method), 4FriendRequest (class in roblox), 12Friendship (class in roblox), 12friendship() (roblox.RobloxSession method), 5friendship() (roblox.User method), 7friendships() (roblox.User method), 6

GGender (class in roblox), 14get() (in module roblox.utils), 17get_asset() (roblox.RobloxSession method), 3get_blurb() (roblox.User method), 7

25

Page 30: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

get_conversation() (roblox.chat.RobloxChatManagermethod), 14

get_description() (roblox.User method), 7get_group() (roblox.RobloxSession method), 3get_presences() (roblox.RobloxSession method), 5get_self() (roblox.RobloxSession method), 3get_shout() (roblox.Group method), 10get_status() (roblox.User method), 7get_user() (roblox.RobloxSession method), 3Group (class in roblox), 9group (roblox.GroupRoleSet attribute), 13group_funds (roblox.Group attribute), 10GroupRoleSet (class in roblox), 13groups() (roblox.User method), 6GroupShout (class in roblox), 13

Hhas_asset() (roblox.User method), 6

Iicon (roblox.Asset attribute), 9id (roblox.Asset attribute), 8id (roblox.chat.Conversation attribute), 15id (roblox.chat.Message attribute), 17id (roblox.Group attribute), 10id (roblox.PrivateMessage attribute), 11id (roblox.User attribute), 6initiator (roblox.chat.Conversation attribute), 15inventory() (roblox.User method), 7is_favorited() (roblox.Asset method), 9is_new (roblox.Asset attribute), 8is_username_taken() (roblox.RobloxSession method), 3

Jjoin() (roblox.Group method), 10join_date (roblox.User attribute), 6join_group() (roblox.RobloxSession method), 5

Llast_updated (roblox.chat.Conversation attribute), 15leave() (roblox.Group method), 10leave_group() (roblox.RobloxSession method), 5limited (roblox.Asset attribute), 8limited_unique (roblox.Asset attribute), 8location_str (roblox.UserPresence attribute), 12logged_in (roblox.RobloxSession attribute), 2login() (roblox.RobloxSession method), 2logout() (roblox.RobloxSession method), 2

Mmark_as_seen() (roblox.chat.Conversation method), 16mark_read() (roblox.PrivateMessage method), 12mark_unread() (roblox.PrivateMessage method), 12

me (roblox.RobloxSession attribute), 2member_count (roblox.Group attribute), 10membership (roblox.User attribute), 6membership_level (roblox.Asset attribute), 8Message (class in roblox.chat), 16MessageInbox (class in roblox), 14multi_user_conversations()

(roblox.chat.RobloxChatManager method),14

MultiUserConversation (class in roblox.chat), 16my_role (roblox.Group attribute), 10

Nname (roblox.Asset attribute), 8name (roblox.Group attribute), 10name (roblox.GroupRoleSet attribute), 13

Oone_to_one_conversations()

(roblox.chat.RobloxChatManager method),15

owned_by() (roblox.Asset method), 9owner (roblox.Group attribute), 10

Pparticipants (roblox.chat.Conversation attribute), 15password (roblox.RobloxSession attribute), 2place_id (roblox.UserPresence attribute), 12place_visits (roblox.User attribute), 6post_comment() (roblox.Asset method), 9post_shout() (roblox.Group method), 10post_status() (roblox.RobloxSession method), 4presence (roblox.User attribute), 7price (roblox.Asset attribute), 8primary_group (roblox.User attribute), 6private_messages() (roblox.RobloxSession method), 5PrivateMessage (class in roblox), 11product_id (roblox.Asset attribute), 8public_domain (roblox.Asset attribute), 8

Rrank (roblox.GroupRoleSet attribute), 13RAP() (roblox.Asset method), 9read (roblox.chat.Message attribute), 17read (roblox.PrivateMessage attribute), 11recent_average_price() (roblox.Asset method), 9recent_messages() (roblox.chat.Conversation method), 15recipient (roblox.FriendRequest attribute), 12recipient (roblox.PrivateMessage attribute), 11remaining (roblox.Asset attribute), 8remove() (roblox.Friendship method), 12remove_from_inventory() (roblox.Asset method), 9remove_participant() (roblox.chat.MultiUserConversation

method), 16

26 Index

Page 31: Release 0.1 · 2019. 4. 2. · CHAPTER 1 API Reference 1.1Client Session class roblox.RobloxSession(username=None, password=None, proxies=None, check_login=False) The RobloxSession,

roblox.py Documentation, Release 0.1.8a2

rename() (roblox.chat.MultiUserConversation method),16

RobloxChatManager (class in roblox.chat), 14RobloxSession (class in roblox), 1robux() (roblox.RobloxSession method), 3robux_parse() (in module roblox.utils), 17role_of() (roblox.Group method), 10roles (roblox.Group attribute), 10roleset_id (roblox.GroupRoleSet attribute), 13

Ssales (roblox.Asset attribute), 8sales_chart() (roblox.Asset method), 9SalesChart (class in roblox), 11send_friend_request() (roblox.RobloxSession method), 4send_friend_request() (roblox.User method), 7send_message() (roblox.chat.Conversation method), 15send_private_message() (roblox.RobloxSession method),

5send_private_message() (roblox.User method), 7sender (roblox.chat.Message attribute), 17sender (roblox.FriendRequest attribute), 12sender (roblox.PrivateMessage attribute), 11set_blurb() (roblox.RobloxSession method), 4set_description() (roblox.RobloxSession method), 4start_conversation() (roblox.chat.RobloxChatManager

method), 15start_typing() (roblox.chat.Conversation method), 16stop_typing() (roblox.chat.Conversation method), 16subject (roblox.PrivateMessage attribute), 11

Ttitle (roblox.chat.Conversation attribute), 15type (roblox.chat.Conversation attribute), 15typing() (roblox.chat.Conversation method), 16

Uunblock() (roblox.RobloxSession method), 3unblock() (roblox.User method), 7unfavorite() (roblox.Asset method), 9unfollow() (roblox.User method), 7unfollow_user() (roblox.RobloxSession method), 4unfriend() (roblox.RobloxSession method), 4unfriend() (roblox.User method), 7unread_conversation_count()

(roblox.chat.RobloxChatManager method),15

unread_conversations() (roblox.chat.RobloxChatManagermethod), 15

unread_message_count() (roblox.RobloxSessionmethod), 3

unread_messages() (roblox.chat.Conversation method),16

updated (roblox.Asset attribute), 8

User (class in roblox), 6user (roblox.UserPresence attribute), 12user0 (roblox.UserRelationship attribute), 12user1 (roblox.UserRelationship attribute), 12user_id (roblox.RobloxSession attribute), 2user_presence (roblox.UserPresence attribute), 12username (roblox.RobloxSession attribute), 2username (roblox.User attribute), 6UserPresence (class in roblox), 12UserPresenceType (class in roblox), 14UserRelationship (class in roblox), 12

Vverify_session() (roblox.RobloxSession method), 3

Wwait_for_message() (roblox.chat.Conversation method),

16

Index 27