ModInfo
— Module command help system¶
Implements global help and helpindex commands that print help information about all available modules. Modules must import and use a decorator from this module. For example:
from pyircbot.modules.ModInfo import info
# ...
@info("help [command]", "show the manual for all or [commands]", cmds=["help"])
@command("help")
def cmd_help(self, msg, cmd):
# ...
The info decorator takes mandatory string parameters describing the command. The first is an argspec; simply the name of the command with parameters marked using < and >. Optional parameters should be encased in [`square brackets]`. The second parameter is a short text description of the command. The third, optional, list parameter cmds is a list of short names thart are aliases for the function that aide in help lookup. In all cases, the cases, commands will be prefixed with the default command prefix (from pyircbot.modulebase.command.prefix).
Class Reference¶
-
class
pyircbot.modules.ModInfo.
ModInfo
(bot, moduleName)[source]¶
-
class
pyircbot.modules.ModInfo.
info
(cmdspec, docstring, cmds=None)[source]¶ Bases:
object
Decorator for tagging module methods with help text
Parameters: - docstring (str) – command help formatted as above
- cmds – enable command names or aliases this function implements, as a list of strings. E.g. if the “help”
command has the alias “rtfm” :type cmds: list