twitter.py 文件源码

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

项目:Harmonbot 作者: Harmon758 项目源码 文件源码
def on_status(self, status):
        ## print(status.text)
        if not status.in_reply_to_status_id and status.user.id_str in set([id for feeds in self.feeds.values() for id in feeds]):
            # TODO: Settings for including replies, retweets, etc.
            for channel_id, channel_feeds in self.feeds.items():
                if status.user.id_str in channel_feeds:
                    embed = discord.Embed(title = '@' + status.user.screen_name, url = "https://twitter.com/{}/status/{}".format(status.user.screen_name, status.id), description = status.text, timestamp = status.created_at, color = clients.twitter_color)
                    embed.set_author(name = status.user.name, icon_url = status.user.profile_image_url)
                    embed.set_footer(text = "Twitter", icon_url = clients.twitter_icon_url)
                    channel = self.bot.get_channel(channel_id)
                    if channel:
                        self.bot.loop.create_task(self.bot.send_message(channel, embed = embed))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号