INNER CODE UNIT · Python

add_last_comment

microsoft/botframework-sdk · dri/helpers.py:92

def add_last_comment(issue, stale_days=10):
    """Takes an issue, adds the last comment time.
    Filters items, where the last comment is not at least stale_days old.
    Returns a copy of the issue.
    """
    comments_paged = issue.get_comments()
    if comments_paged.totalCount == 0:
        return None
    last_comment = ([msg for msg in comments_paged] or [None])[-1]
    assert last_comment
    if last_comment.created_at > (datetime.utcnow() - timedelta(days=stale_days)):
        # Filter items.
        return None
    result = copy.copy(issue)
    result.last_comment = last_comment.created_at
    return result

def filter_bot_service_label(issue):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…