def get_message(output):
    """Gets payload from output.
    Args:
        output: output from request

    Returns:
        string with payload

    """
    for event in output['entry']:
        for message in event['messaging']:
            if message.get('message'):
                if message['message'].get('quick_reply'):
                    return message['message']['quick_reply']['payload']
                if message['message'].get('text'): 
                    return message['message']['text']
            if message.get('postback'):
                return message['postback']['payload']