def fetch_posts(subreddit, sort='hot', top_num=5):
    try:
        sub = Reddit.get_subreddit(subreddit)
        resp = getattr(sub, SORT_TYPES[sort])(limit=top_num)
        data = _get_post_header(subreddit, sort, top_num)
        for i, post in enumerate(resp):
            post_number = i + 1
            data += ('%s. *[%s]* <%s|%s>\n' %
                     (post_number, post.score, post.url, post.title))
        return _create_response(data)
    except praw.errors.InvalidSubreddit:
        return _create_response('Specify a subreddit that exists!')
Rebuild the menu.
dataset/ETHPy150Open arjunblj/slack-reddit/app.py/fetch_posts--crossover with--dataset/ETHPy150Open enthought/pyface/pyface/workbench/action/perspective_menu_manager.py/PerspectiveMenuManager.rebuild