import robloxapi, asyncio
client = robloxapi.Client(".ROBLOSECURITY Cookie Here") # Removed this for security reasons
async def main():
user = await client.get_self()
try:
role = await user.get_role_in_group(1)
except robloxapi.utils.errors.NotFound:
role = None
if role:
print(role.name)
else:
print("Not in group")
asyncio.run(main())
This code is raising RuntimeError: Event loop is closed
and I don't have a clue why,
I have tried replacing asyncio.run with this
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()
but it gave me the same error