From acc49cacf70cfa869bf1253e8f74a9c4178b9474 Mon Sep 17 00:00:00 2001 From: nex Date: Mon, 16 Oct 2023 14:50:32 +0100 Subject: [PATCH] Actually add code to unmount_module --- src/niobot/client.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/niobot/client.py b/src/niobot/client.py index 78721a9..36c5976 100644 --- a/src/niobot/client.py +++ b/src/niobot/client.py @@ -398,14 +398,15 @@ def mount_module(self, import_path: str) -> typing.Optional[list[Command]]: self.log.debug("%r does not appear to be a niobot module", item) return added - def unmount_module(self, import_path: str) -> None: + def unmount_module(self, module: Module) -> None: """ Does the opposite of mounting the module. This will remove any commands that have been added to the bot from the given module. - :param import_path: - :return: + :param module: The module to unmount """ + self.log.debug("Unmounting module %r", module) + module.__teardown__() @property def commands(self) -> dict[str, Command]: