File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments