diff options
| author | 2019-11-21 10:39:26 +0000 | |
|---|---|---|
| committer | 2019-11-21 10:39:26 +0000 | |
| commit | 9f8c5acf525754eda6025abe6333de81180ba595 (patch) | |
| tree | 09d9a620797ba0bfbd09ebf62635b9273b51e18c /modules | |
| parent | support "$$" as a literal "$" in alias arg replacements (diff) | |
add a way to execute commands through bitbotd (use for master-password)
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/permissions/__init__.py | 10 |
1 files changed, 4 insertions, 6 deletions
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): """ |
