twitter.py 文件源码

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

项目:Harmonbot 作者: Harmon758 项目源码 文件源码
def start_twitter_feeds(self):
        await self.bot.wait_until_ready()
        feeds = {}
        for channel_id, channel_info in self.feeds_info["channels"].items():
            for handle in channel_info["handles"]:
                try:
                    feeds[channel_id] = feeds.get(channel_id, []) + [clients.twitter_api.get_user(handle).id_str]
                except tweepy.error.TweepError as e:
                    if e.api_code == 50:
                    # User not found
                        continue
                    else:
                        print("Exception in Twitter Task", file = sys.stderr)
                        traceback.print_exception(type(e), e, e.__traceback__, file = sys.stderr)
                        logging.errors_logger.error("Uncaught Twitter Task exception\n", exc_info = (type(e), e, e.__traceback__))
                        return
        await self.stream_listener.start_feeds(feeds = feeds)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号