def is_pr_comment(event):
    """Determine if a comment applies to a pull request."""
    try:
        right_type = event.type == 'IssueCommentEvent'
        right_payload = 'pull_request' in event.payload['issue'].to_json()
        return right_type and right_payload
    except (KeyError, IndexError, AttributeError, TypeError):
        return False