@staticmethod
def check_basic_properties(msg, handler):
    """Helper utility to ensure messages fulfill certain basic criteria before they are passed to their handlers.

        :param msg: the message to be tested.
        :param handler: the handler (a return from client.connection.cmd) to be tested for."""
    necessary_params, needs_reply = handler
    for necessary in necessary_params:
        if necessary not in msg.params:
            raise ValueError('Necessary parameter was not passed: ' + necessary
                )
    if needs_reply and not msg.replyable():
        raise ValueError(
            'This command needs to be replyable but the message was not: ' +
            str(msg))
