Can you please let me know how to return the asset ID of a published asset.
The Asset
class has a attribute called id
which will be the uploaded asset’s ID. Here’s is an example uploading a file, and then ensuring the file is not pending then getting it’s asset ID:
with open('path-to/file.png', 'rb') as file:
creator.upload_asset(file, AssetType.Decal, "Asset Name", "This is the description")
if not isinstance(asset, rblxopencloud.Asset):
while True:
status = asset.fetch_status()
if status:
asset = status
break
print(asset.id)
You can learn more about Creator.upload_asset
on the documentation.
Thanks for the quick response! GOing to try this out as I was receiving UUID instead of numerical form outside of this API wrapper.
Great work! Going to utilize this for a notifications project I’ve been working on.
Any chance that https://apis.roblox.com/assets/v1/assets/{assetId} could be added the API here? Been needing to retrieve asset metadata via the API. Thanks for considering!
It’s available in the V2 beta of the library. I’m working on getting V2 out soon and will make a page on migrating to it eventually.
the V2 docs: Creator - rblx-open-cloud
installing V2:
pip install git+https://github.com/treeben77/rblx-open-cloud.git@v2 --force
v2.0.0 - Version 2
Version 2 is finally here! Now with many new library features, including:
- Many new APIs including experience restrictions, subscriptions, join requests, memory stores, notifications and more.
- Asynchronous version of the library
- New
send_request
function and other shortcut functions - Many breaking changes from v1 - read more
If you do not wish to migrate to v2 to avoid breaking changes, use the following import:
pip install rblx-open-cloud==1.6.0
Thanks to @Bulldo344, @ignaigna on GitHub and @treeben77
GitHub Release: Release v2.0.0 - Version 2 of rblx-open-cloud! · treeben77/rblx-open-cloud · GitHub
Upgrading with pip:
pip install rblx-open-cloud~=2.0
v2.1.0 - Update Group Members
- Add
Group.update_member()
. Allows for the update of group member’s ranks. - Add
GroupMember.update
as a shortcut for the previous method.
This is in response to Introducing Roblox Communities
GitHub Release: Release v2.1.0 - Update Group Member · treeben77/rblx-open-cloud · GitHub
Upgrading with pip:
pip install rblx-open-cloud~=2.1
Hi! I was having an issue using the group.fetch_member()
function.
I validated the group with the correct ID and API key, and used print statements & checked the API key manually and it was valid. The API key has read and write permissions.
For some reason, it kept giving me an Unauthorized Access
error whenever I tried to use that function (used a try error command to print out the error message).
Any help would be appreciated, thank you!
Is your API key owned by the group itself? This sounds counter intuitive but the API key needs to be owned by a user such as the group owner to access group APIs.
API key is owned by the group… how would I set it up if it’s owned by the user?
Nevermind, figured it out. Thanks!
v2.2.0 - Secrets Store
- Added support for secrets store apis,
- Added
Conflict
exception. -
PreconditionFailed
now basesConflict
which still basesHttpException
.
GitHub Release: Release v2.1.0 - Update Group Member · treeben77/rblx-open-cloud · GitHub
Secret Stores Documentation: Experience - rblx-open-cloud
Upgrading with pip:
pip install rblx-open-cloud~=2.2
For whatever reason now as of v2.2.1, using datastore set_entry will throw an error about ‘createdTime’ in datastore.py, line 368. I think the datastore SetAsync is working, but attempting to return data[“createdTime”] throws an error for whatever reason.
This is an issue with Roblox not the library, but I will implement a (hopefully temporary fix) to mitigate this issue. Referencing this bug:
Thanks for your report!
EDIT: If you don’t care about the time the version was created in the set entry variable, then in v2.2.2 I have made the library not throw an exception when it is unexpectedly missing.
Hey @TreeBen77 ! First of all, thanks so much for making this, it’s been a great tool for a project I’m doing in python.
I ran into a bug, let me know how issues like this should be handled for your project! I can raise it as an Issue on Github, or try to submit a fix myself, or just leave it to you.
Feel free to open a pull request to fix this and open up a GitHub issue. Thanks for your contributions!
Thanks! I opened an issue for it, and tried to push my fix to a new branch, but seems like I’m denied access. Do I need to be added as a collaborator or something first?
Looks like treeben77 beat you to it as he commented on your pull request:
with other repositories on github, you will need to create your own fork, push your changes their and then open a pull request. I have fixed the issue but in the future that’s how to contribute on open source projects. Thanks for reporting the issue!