be fully relied upon. Certain methods have been intentionally left out. """ import os import asyncio from typing import Optional from loguru import logger from roblox import Client from roblox.users import User from roblox.utilities.exceptions import Unauthorized client = Client(os.getenv("ROBLOX_TOKEN")) async def test_user_id(user_id: int): """ Tests get_users, get_user, and get_base_user on this user ID. """ user = await client.get_user(user_id) alt_user = (await client.get_users([user_id]))[0] base_user = client.get_base_user(user_id) return user.id == alt_user.id == base_user.id async def test_user_id_name(user_id: int): """ Tests to see if get_user(user.id) == get_user_by_username(user.name)
""" Boilerplate for a standalone ro.py application. """ import asyncio from roblox import Client client = Client() async def main(): """ Place your code here. """ pass asyncio.get_event_loop().run_until_complete(main())
""" Grabs place information. A cookie is required to grab place information. """ import asyncio from roblox import Client client = Client("cookie_here") async def main(): place = await client.get_place(8100260845) print("ID:", place.id) print("Name:", place.name) print(f"Description: {place.description!r}") print("Playable:", place.is_playable) if not place.is_playable: print("Reason:", place.reason_prohibited) if place.price > 0: print("Price:", place.price) print("Creator:", place.builder) asyncio.get_event_loop().run_until_complete(main())