#๐ something weird is with ro.py
13 messages ยท Page 1 of 1 (latest)
@torpid pebble
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
so basically this is the code
`import ro_py
from ro_py import Client, User # Trying to import User directly from ro_py
cookie = 'YOUR_COOKIE_HERE'
client = Client(cookie)
def follow_user(user_id):
try:
user = User(user_id=user_id, client=client)
user.follow() # This sends the follow request
print(f"Successfully followed user: {user.name}")
except Exception as e:
print(f"Failed to follow user: {e}")
user_id = int(input("Enter the Roblox user ID to follow: "))
follow_user(user_id)
`
and so
this is the problem
Traceback (most recent call last):
File "C:\moneymoneymoney.py", line 2, in <module>
from ro_py import Client, User # Trying to import User directly from ro_py
ImportError: cannot import name 'User' from 'ro_py' (C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\ro_py_init_.py)
I think ro_py got renamed https://pypi.org/project/roblox/#data
Where did you find this code?
https://github.com/ro-py/ro.py/blob/main/roblox/utilities/requests.py#L68
Looks like it spoofs the user agent so probably against the rules
roblox/utilities/requests.py line 68
self.session.headers["User-Agent"] = "Roblox/WinInet"```
Although it's freely discussed on their community forum https://devforum.roblox.com/t/use-python-to-interact-with-the-roblox-api-with-ropy/1006465
GitHub | Discord | PyPI | Documentation | Examples | License Overview Welcome to ro.py! ro.py is an asynchronous, object-oriented wrapper for the Roblox web API. Features The key features are: Asynchronous: ro.py works well with asynchronous frameworks like FastAPI and discord.py. Easy: ro.pyโs client-based model i...
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.