On hook declaration, we can now add a help and/or a help_usage argument to provide a simple way to the user to be informed. For example: ```python @hook("cmd_hook", "news", help_usage={"URL": "Display the latests news from a given URL"}) def cmd_news(msg): [...] ``` will be displayed on !help !news as: > Usage for command !news from module news: !news URL: Display the latests news from a given URL Or for module commands help: ```python @hook("cmd_hook", "news", help="display latests news") def cmd_news(msg): [...] ``` will be displayed on !help mymodule (assuming this hook is in the module named mymodule) as: > Available commands for module news: news: display latests news Obviously, both `help` and `help_usage` can be present. If `help_usage` doesn't exist, help on usage will display the content of help. |
||
---|---|---|
.. | ||
datastore | ||
event | ||
hooks | ||
message | ||
prompt | ||
server | ||
tools | ||
__init__.py | ||
__main__.py | ||
bot.py | ||
channel.py | ||
consumer.py | ||
exception.py | ||
importer.py | ||
modulecontext.py |