Add graceful exits
This sets up a set of ropes and pulleys that signal the `Bot.keepalive` function to clean things up after a quit signal has been sent. This allows plugins to define an `on_unload` function to save any important datas on intentional exit. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -51,6 +51,9 @@ class Plugin:
|
||||
async def on_message(self, conn: IrcProtocol, channel: str, who: Prefix, line: str):
|
||||
pass
|
||||
|
||||
async def on_unload(self, conn: IrcProtocol):
|
||||
pass
|
||||
|
||||
|
||||
def load_plugin(server_config: ServerConfig, plugin_config: PluginConfig) -> Plugin:
|
||||
name = plugin_config["module"]
|
||||
|
||||
Reference in New Issue
Block a user