Skip to content

Commit

Permalink
✨ Some debugging and name change
Browse files Browse the repository at this point in the history
  • Loading branch information
tookender committed May 4, 2024
1 parent b93e610 commit c5414c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extensions/ipc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ def __init__(self, bot: Korii):
self.app = app
self.router = app.router
self.router.add_route("get", "/ping", self.ping)
self.router.add_route("post", "/in_server", self.is_in_server)
self.router.add_route("post", "/is_in_guild", self.is_in_guild)
self.bot.loop.create_task(self._start())

async def ping(self, _) -> Response:
return json_response({"latency": self.bot.latency * 1000})

async def is_in_server(self, request: Request) -> Response:
async def is_in_guild(self, request: Request) -> Response:
data = await request.json()
guild = data.get("guild")

Expand All @@ -27,7 +27,7 @@ async def is_in_server(self, request: Request) -> Response:
else:
in_server = False

return json_response({"in_server": in_server})
return json_response({"is_in_guild": in_server, "guild": int(guild)})

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

0 comments on commit c5414c7

Please sign in to comment.