wa1ker38552 / rolimons.py

A Python API wrapper for Rolimons
Apache License 2.0
10 stars 4 forks source link

Are you able to request the usernames of people who own a specific item? #14

Closed ghost closed 1 year ago

ghost commented 1 year ago

I want to be able to pull trading information for people who have a certain item available for trading, this is usually listed underneath the item in the "owners list" I was wondering if there is a way to get the names of the people on the list.

wa1ker38552 commented 1 year ago

I will write up some code to add that as a feature soon -within 1-2 days if it is possible. It currently isn't a feature though.

wa1ker38552 commented 1 year ago

Sorry for the delay, I implemented the feature and it should be in rolimons==2.5.4. There isn't any documentation for it yet so I'll just explain how to call it. After you create an item object using rolimons.item() you can call the get_owner_data() function on it. That will return an ItemOwners object which you can then call attributes and functions like .owners or .get_premium_owners() Calling .owners returns a dictionary with information like the uaid, name, and id Additionally, you can also call ItemOwners.num_copies to get the total amount of copies. However, if you want to get copies information you can use the existing get_ownership_data function. Hope this helps 😁