Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typing fixes + docs improvements #121

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
6 changes: 3 additions & 3 deletions roblox/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def set_birthday(
}
)

async def get_description(self) -> string:
async def get_description(self) -> str:
"""
Gets the authenticated user's description.

Expand All @@ -81,14 +81,14 @@ async def get_description(self) -> string:

async def set_description(
self,
description: string,
description: str,
):
"""
Updates the authenticated user's description.
This endpoint *may* require your token, and requires an unlocked PIN.

Arguments:
description: A string object that represents the description to update the Client's account to.
description: A string containing the authenticated user's new description.
"""
await self._client.requests.post(
url=self._client.url_generator.get_url("accountinformation", "v1/description"),
Expand Down
46 changes: 23 additions & 23 deletions roblox/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ class AssetType:
Represents a Roblox asset type.

Attributes:
id: Id of the Asset
name: Name of the Asset
Jodenee marked this conversation as resolved.
Show resolved Hide resolved
id: Id of the Asset.
name: Name of the Asset.
"""

def __init__(self, type_id: int):
Expand All @@ -119,27 +119,27 @@ class EconomyAsset(BaseAsset):
It is intended to parse data from https://economy.roblox.com/v2/assets/ASSETID/details.

Attributes:
id: Id of the Asset
product_id: Product id of the asset
name: Name of the Asset
description: Description of the Asset
type: Type of the Asset
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we shouldn't need to write "... of the Asset." over and over, although I don't know what exactly to put there instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could make it "The asset's ..." but I'm not really sure if that's better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the attribute descriptions to have less repetition is it better now?

creator_type: Type of creator can be user or group see enum
Jodenee marked this conversation as resolved.
Show resolved Hide resolved
creator: creator can be a user or group object
icon_image: BaseAsset
created: When the asset was created
updated: When the asset was updated for the las time
Jodenee marked this conversation as resolved.
Show resolved Hide resolved
price: price of the asset
sales: amount of sales of the asset
is_new: if the asset it new
is_for_sale: if the asset is for sale
is_public_domain: if the asset is public domain
is_limited: if the asset is a limited item
is_limited_unique: if the asset is a unique limited item
remaining: How many items there are remaining if it is limited
minimum_membership_level: Minimum membership level required to buy item
content_rating_type_id: Unknown
sale_availability_locations: Unknown
id: Id of the Asset.
product_id: Product id of the asset.
name: Name of the Asset.
description: Description of the Asset.
type: Type of the Asset.
creator_type: Type of creator can be user or group see enum.
creator: creator can be a user or group object.
icon_image: A [BaseAsset][roblox.bases.baseasset.BaseAsset] representing the asset's icon.
created: When the asset was created.
updated: When the asset was updated for the las time.
price: price of the asset.
sales: amount of sales of the asset.
is_new: if the asset it new.
is_for_sale: if the asset is for sale.
is_public_domain: if the asset is public domain.
is_limited: if the asset is a limited item.
is_limited_unique: if the asset is a unique limited item.
remaining: How many items there are remaining if it is limited.
minimum_membership_level: Minimum membership level required to buy item.
content_rating_type_id: Unknown.
sale_availability_locations: Unknown.
"""

def __init__(self, client: Client, data: dict):
Expand Down
6 changes: 3 additions & 3 deletions roblox/badges.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ class Badge(BaseBadge):
Represents a badge from the API.

Attributes:
id: The badge Id.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it "a badge ID" or "a badge's ID"? i honestly don't know what's best, but considering we talk about "user IDs" a lot I'm leaning towards "The badge ID."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something about "The badge ID" doesn't really sit well with me. "The badge's ID" just sounds more clear and it's more consistent with other pages too. What do you think?

id: The badge's Id.
name: The name of the badge.
description: The badge description.
display_name: The localized name of the badge.
display_description: The localized badge description.
enabled: Whether or not the badge is enabled.
icon: The badge icon.
icon: The badge's icon.
display_icon: The localized badge icon.
created: When the badge was created.
updated: When the badge was updated.
updated: When the badge was last updated.
statistics: Badge award statistics.
awarding_universe: The universe the badge is being awarded from.
"""
Expand Down
2 changes: 1 addition & 1 deletion roblox/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __repr__(self):
def set_token(self, token: Optional[str] = None) -> None:
"""
Authenticates the client with the passed .ROBLOSECURITY token.
This method does not send any requests and will not throw if the token is invalid.
This method does not send any requests and will not throw an exception if the token is invalid.

Arguments:
token: A .ROBLOSECURITY token to authenticate the client with.
Expand Down
4 changes: 2 additions & 2 deletions roblox/partials/partialbadge.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class PartialBadge(BaseBadge):

Attributes:
_data: The data we get back from the endpoint.
_client: The cCient object, which is passed to all objects this Client generates.
id: The universe ID.
_client: The Client object, which is passed to all objects this Client generates.
id: The badge's ID.
awarded: The date when the badge was awarded.
"""

Expand Down
2 changes: 1 addition & 1 deletion roblox/partials/partialgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AssetPartialGroup(BaseGroup):

Attributes:
_client: The Client object, which is passed to all objects this Client generates.
id: The group's name.
id: The group's ID.
creator: The group's owner.
name: The group's name.
has_verified_badge: If the group has a verified badge.
Expand Down
4 changes: 2 additions & 2 deletions roblox/partials/partialuniverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class PartialUniverse(BaseUniverse):

Attributes:.
_client: The Client object, which is passed to all objects this Client generates.
id: The universe ID.
id: The universe's ID.
name: The name of the universe.
root_place: The universe's root place.
"""
Expand Down Expand Up @@ -47,7 +47,7 @@ class ChatPartialUniverse(BaseUniverse):
Attributes:
_data: The data we get back from the endpoint.
_client: The client object, which is passed to all objects this client generates.
id: The universe ID.
id: The universe's ID.
root_place: The universe's root place.
"""

Expand Down