Update Plugins to keep a reference to the Bot object instead of server_config
Plugins now use Bots instead of server_configs, this is useful for checking the currently joined channels and perhaps using the connection when there isn't one available in the current method. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -16,14 +16,13 @@ log = logging.getLogger(__name__)
|
||||
class Bot:
|
||||
def __init__(self, server_config: ServerConfig):
|
||||
self.__server_config = server_config
|
||||
self.__channels: Set[str] = set()
|
||||
self.__quitting = asyncio.Event()
|
||||
self.__plugins = [
|
||||
plugin.load_plugin(server_config, config)
|
||||
plugin.load_plugin(self, config)
|
||||
for config in server_config.plugins
|
||||
if config.get("enabled", True)
|
||||
]
|
||||
# TODO - this may not be needed
|
||||
self.__channels: Set[str] = set()
|
||||
self.__quitting = asyncio.Event()
|
||||
|
||||
@property
|
||||
def server_config(self) -> ServerConfig:
|
||||
|
||||
Reference in New Issue
Block a user