From 9f8c5acf525754eda6025abe6333de81180ba595 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 21 Nov 2019 10:39:26 +0000 Subject: add a way to execute commands through bitbotd (use for master-password) --- modules/permissions/__init__.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/permissions/__init__.py b/modules/permissions/__init__.py index 0311dfa3..639c1b01 100644 --- a/modules/permissions/__init__.py +++ b/modules/permissions/__init__.py @@ -23,12 +23,10 @@ class Module(ModuleManager.BaseModule): self.bot.set_setting("master-password", [hash, salt]) return master_password - def command_line(self, args: str): - if args == "master-password": - master_password = self._master_password() - print("one-time master password: %s" % master_password) - else: - raise ValueError("Unknown command-line argument") + @utils.hook("control.master-password") + def command_line(self, event): + master_password = self._master_password() + return "One-time master password: %s" % master_password @utils.hook("received.command.masterpassword", private_only=True) def master_password(self, event): """ -- cgit v1.3.1-10-gc9f91