Add on_load for plugins

This asynchronous function is called on all plugins right before the IRC
connection is made.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2022-05-26 19:06:48 -07:00
parent 85d48d368c
commit f0cfe53c8e
2 changed files with 5 additions and 0 deletions

View File

@@ -45,6 +45,8 @@ class Bot:
self.server_config.port,
self.server_config.use_ssl,
)
log.info("Initializing plugins")
await asyncio.gather(*[plugin.on_load() for plugin in self.plugins])
self.connection = IrcProtocol([server], self.server_config.nick, loop=loop)
# Register events
# self.connection.register("*", self.on_message)