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):
48
48
def __init__ (self ):
49
49
super ().__init__ (command_prefix = self .get_pre )
50
50
self .start_time = datetime .datetime .utcnow ()
51
- self .session = aiohttp .ClientSession ()
52
51
self .loop .create_task (self .data_loop ())
53
52
self ._add_commands ()
54
53
@@ -88,6 +87,7 @@ async def get_pre(bot, message):
88
87
async def on_connect (self ):
89
88
print ('---------------' )
90
89
print ('Modmail connected!' )
90
+ self .session = aiohttp .ClientSession ()
91
91
status = os .getenv ('STATUS' ) or self .config .get ('STATUS' )
92
92
if status :
93
93
print (f'Setting Status to { status } ' )
@@ -259,7 +259,8 @@ async def about(self, ctx):
259
259
'easily communicate with server leadership in an organised manner.'
260
260
261
261
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 ()
263
264
except :
264
265
meta = None
265
266
You can’t perform that action at this time.
0 commit comments