diff --git a/cloudbot/bot.py b/cloudbot/bot.py index d3f4a16da..21582b6db 100644 --- a/cloudbot/bot.py +++ b/cloudbot/bot.py @@ -11,6 +11,7 @@ from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.schema import MetaData +from watchdog.observers import Observer from cloudbot.client import Client from cloudbot.clients.irc import IrcClient, irc_clean @@ -118,6 +119,8 @@ def __init__(self, loop=asyncio.get_event_loop()): # create bot connections self.create_connections() + self.observer = Observer() + if self.plugin_reloading_enabled: self.plugin_reloader = PluginReloader(self) @@ -171,6 +174,8 @@ def stop(self, reason=None, *, restart=False): logger.debug("Stopping plugin reloader.") self.plugin_reloader.stop() + self.observer.stop() + for connection in self.connections.values(): if not connection.connected: # Don't quit a connection that hasn't connected