Skip to content

Commit d43e7fa

Browse files
committed
Fix cmd
1 parent e766027 commit d43e7fa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ class Modmail(commands.Bot):
4848
def __init__(self):
4949
super().__init__(command_prefix=self.get_pre)
5050
self.start_time = datetime.datetime.utcnow()
51-
self.session = aiohttp.ClientSession()
5251
self.loop.create_task(self.data_loop())
5352
self._add_commands()
5453

@@ -88,6 +87,7 @@ async def get_pre(bot, message):
8887
async def on_connect(self):
8988
print('---------------')
9089
print('Modmail connected!')
90+
self.session = aiohttp.ClientSession()
9191
status = os.getenv('STATUS') or self.config.get('STATUS')
9292
if status:
9393
print(f'Setting Status to {status}')
@@ -259,7 +259,8 @@ async def about(self, ctx):
259259
'easily communicate with server leadership in an organised manner.'
260260

261261
try:
262-
meta = await self.session.get('https://api.kybr.tk/modmail')
262+
async with self.session.get('https://api.kybr.tk/modmail'):
263+
meta = await resp.json()
263264
except:
264265
meta = None
265266

0 commit comments

Comments
 (0)