From 47af56283b3c4af39e7f61582d743ced9cb829e4 Mon Sep 17 00:00:00 2001 From: nsde Date: Mon, 4 Sep 2023 13:24:28 +0200 Subject: [PATCH] Prune thingy --- cord/api.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cord/api.py b/cord/api.py index 1468429..f17754c 100644 --- a/cord/api.py +++ b/cord/api.py @@ -15,10 +15,8 @@ async def start(client): user_roles = {member.id: [role.name for role in member.roles] for member in members} return user_roles - async def get_roles(request): - return aiohttp.web.json_response(await get_userinfo()) - - app.router.add_get('/get_roles', get_roles) + app.router.add_get('/get_roles', lambda request: aiohttp.web.json_response(get_userinfo())) + app.router.add_get('/user_ids', lambda request: aiohttp.web.json_response([member.id for member in client.get_guild(int(os.getenv('DISCORD_GUILD'))).members])) app.router.add_get('/ping', lambda request: aiohttp.web.Response(text='pong')) runner = aiohttp.web.AppRunner(app)