async def _on_shutdown(self) -> None:
    if (self.repl is not None):
        self.repl.stop()
    for event in bc.background_events:
        event.cancel()
    bc.background_loop = None
    (await bc.plugin_manager.broadcast_command('close'))
async def _on_shutdown(self) -> None:
    if (self.repl is not None):
        self.repl.stop()
    for event in bc.background_events:
        event.cancel()
    bc.background_loop = None
    (await bc.plugin_manager.broadcast_command('close'))