Commit Graph

5 Commits

Author SHA1 Message Date
9790954dfc Hooks can now contain help on optional keywords 2015-11-03 07:22:01 +01:00
4cb8b0f1a6 Improve help
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.
2015-09-24 11:29:51 +02:00
3c51b1f03b Add assertion on class initialization 2015-09-24 11:29:49 +02:00
787a5fd3da Web tool raise more IRCException 2015-08-26 12:17:21 +02:00
002f2463a3 Extract hooks 2015-05-25 16:44:28 +02:00