twittercog.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:brochat-bot 作者: nluedtke 项目源码 文件源码
def get_news(self, ctx):
        """Grab a news story"""
        if common.twitter is None:
            return

        shuffle(common.news_handles)
        found_art = False

        while not found_art:
            source = common.news_handles.pop(0)
            common.news_handles.append(source)
            tweet_text = "It looks like @" + source + " is reporting:"
            rt_text = "It looks like @" + source + " is retweeting:"

            try:
                await get_last_tweet(source, tweet_text, rt_text, ctx)
            except TwythonError:
                print("Error in get_news, trying another source")

            else:
                found_art = True

        return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号