From b8e6bfd5e56718466ba89f1b0c02ffc1331fe99a Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 11 Nov 2018 09:02:48 +0000 Subject: [PATCH] Add a way of appending a comment on an API key, to denote what it's for. --- modules/rest_api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/rest_api.py b/modules/rest_api.py index 3a08cf70..02a4e124 100644 --- a/modules/rest_api.py +++ b/modules/rest_api.py @@ -108,9 +108,13 @@ class Module(ModuleManager.BaseModule): def api_key(self, event): """ :help: Generate a new API key + :usage: [comment] :permission: api-key :prefix: APIKey """ api_key = str(uuid.uuid4()) + if event["args_split"]: + api_key = "%s-%s" % (event["args_split"][0], api_key) + self.bot.set_setting("api-key-%s" % api_key, True) event["stdout"].write(api_key)