diff options
| -rw-r--r-- | bot/cogs/events.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/bot/cogs/events.py b/bot/cogs/events.py index 42f254a0c..325675039 100644 --- a/bot/cogs/events.py +++ b/bot/cogs/events.py @@ -22,16 +22,13 @@ class Events: self.bot = bot async def send_updated_users(self, *users): - session = ClientSession( - headers={"X-API-Key": SITE_API_KEY} - ) - - response = await session.post( - url=SITE_API_USER_URL, - json=list(users) - ) + with ClientSession(headers={"X-API-Key": SITE_API_KEY}) as session: + response = await session.post( + url=SITE_API_USER_URL, + json=list(users) + ) - return await response.json() + return await response.json() async def on_command_error(self, ctx: Context, e: CommandError): command = ctx.command |