def by_chat_command(prefix=('/',), separator=' ', pass_args=False):
    """
    :param prefix:
        a list of special characters expected to indicate the head of a command.

    :param separator:
        a command may be followed by arguments separated by ``separator``.

    :type pass_args: bool
    :param pass_args:
        If ``True``, arguments following a command will be passed to the handler
        function.

    :return:
        a key function that interprets a chat message's text and returns
        the embedded command, optionally followed by arguments. If the text is
        not preceded by any of the specified ``prefix``, it returns a 1-tuple
        ``(None,)`` as the key. This is to distinguish with the special
        ``None`` key in routing table.
    """
    return by_command(lambda msg: msg['text'], prefix, separator, pass_args)