File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ def run(self):
130130 self .loop .run_until_complete (self ._init_routine ())
131131 # Wait till the bot stops. The stopped_future will be set to True to restart, False otherwise
132132 restart = self .loop .run_until_complete (self .stopped_future )
133+ self .loop .run_until_complete (self .plugin_manager .unload_all ())
133134 self .loop .close ()
134135 return restart
135136
Original file line number Diff line number Diff line change @@ -112,6 +112,12 @@ def load_all(self, plugin_dir):
112112 # Load plugins asynchronously :O
113113 yield from asyncio .gather (* [self .load_plugin (path ) for path in path_list ], loop = self .bot .loop )
114114
115+ @asyncio .coroutine
116+ def unload_all (self ):
117+ yield from asyncio .gather (
118+ * [self .unload_plugin (path ) for path in self .plugins .keys ()], loop = self .bot .loop
119+ )
120+
115121 @asyncio .coroutine
116122 def load_plugin (self , path ):
117123 """
You can’t perform that action at this time.
0 commit comments