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
On Windows do this:
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
asyncio.run(main())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With