Skip to content

Commit

Permalink
✨ Improve bot_guilds
Browse files Browse the repository at this point in the history
  • Loading branch information
tookender committed May 4, 2024
1 parent b2ac324 commit 2c3b3b0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions extensions/ipc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,9 @@ async def ping(self, _) -> Response:

async def bot_guilds(self, request: Request) -> Response:
data = await request.json()
guilds = data.get("guilds")
bot_guilds = []
valid_guilds = [guild for guild in data if self.bot.get_guild(guild["id"])]

for guild in guilds:
if self.bot.get_guild(guild):
bot_guilds.append(guild)

return json_response({"bot_guilds": bot_guilds, "guilds": guilds})
return json_response({"guilds": valid_guilds})

async def _start(self):
await self.bot.wait_until_ready()
Expand Down

0 comments on commit 2c3b3b0

Please sign in to comment.