Add a way of appending a comment on an API key, to denote what it's for.
This commit is contained in:
parent
b06eff217f
commit
b8e6bfd5e5
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue