Help Plugin

This plugin is built-in.

This plugin provides two commands: !commands and !help. It also providess the help and commands hooks to let plugin authors to let users read bot documentation from the bot.

Config

disable-help: boolean

[Deprecated] Use "command-ignore-list": ["commands", "help"] instead.

Disables the plugin.

Commands

!help <topic>

Gives the help information about that topic.

Can also search subtopics.

Should no topic be given, the help topic for the help command will be given.

In the case that there is no topic for the topic, the bot will respond with:

> Help message for selected topic does not exist.

All responses will be in query.

!commands

Lists the names of known commands.

<user> tennubot: commands
<tennubot> List of known commands:
<tennubot> help, commands

Exports

help(query: [string]) -> string | [String] | HELP_NOT_FOUND

Return the help message for the specified query. It's a functional version of the !help command.

helpObject() -> Object

Returns the entire help registry. This is an object that joins all the keys from the objects passed to the help hook.

HELP_NOT_FOUND

Sentinel value returned by help export function when the query doesn't exist in the registry.

Hooks

help

The general form of the value is a dictionary of topics that take a dictionary of subtopics along with an '\*' property for the help message for that topic itself.

The help message may either be a string or an array of strings for multiline messages.

For example, here is the help object for a time plugin:

{
    time: {
        '*': [
            "The time plugin gives time information as requested.",
            "",
            "Subcommands: ",
            "!time at &lt;place&gt;",
            "!time zone &lt;place&gt;",
            "!time between &lt;place&gt; and &lt;place&gt;"
        ],
        
        // Help messages omitted for brevity.
        at: "...",
        zone: "...",
        between: "..."
    }
}

Simple Represenations

Should your topic not have any subtopics, you may use a string or array directly.

Thus, the 'zone' property in the preceding example is equivalent to:

{ '*': "..." }

Should your plugin only need to respond to the query that is the plugin's name, the help value may be just a string or array.

Tip

The help object can be placed into a JSON file and required in if it gets too long.

commands

A list of command names that you want added to the output of !commands.