def nickname_commands(*command_list):
    """Decorate a function to trigger on lines starting with "$nickname: command".

    :param str command_list: one or more command name(s) to match
                             (can be regular expressions)

    This decorator can be used to add multiple commands to one callable in a
    single line. The resulting match object will have the command as the first
    group; the rest of the line, excluding leading whitespace, as the second
    group; and parameters 1 through 4, separated by whitespace, as groups 3-6.

    Example::

        @nickname_commands("hello!")
            # Would trigger on "$nickname: hello!", "$nickname,   hello!",
            # "$nickname hello!", "$nickname hello! parameter1" and
            # "$nickname hello! p1 p2 p3 p4 p5 p6 p7 p8 p9".

        @nickname_commands(".*")
            # Would trigger on anything starting with "$nickname[:,]? ",
            # and would never have any additional parameters, as the
            # command would match the rest of the line.

    """
    def add_attribute(function):
        if not hasattr(function, 'nickname_commands'):
            function.nickname_commands = []
        for cmd in command_list:
            if cmd not in function.nickname_commands:
                function.nickname_commands.append(cmd)
        return function
    return add_attribute