safe_core.py 文件源码

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

项目:apex-sigma-core 作者: lu-ci 项目源码 文件源码
def generate_embed(post, titles, color=0xff6699, icon='https://i.imgur.com/WQbzk9y.png'):
    image_url = post.attrib['file_url']
    image_source = f'http://safebooru.org/index.php?page=post&s=view&id={post.attrib["id"]}'
    if image_url.startswith('//'):
        image_url = 'https:' + image_url
    embed = discord.Embed(color=color)
    embed.set_author(name=secrets.choice(titles), icon_url=icon, url=image_source)
    embed.set_image(url=image_url)
    embed.set_footer(
        text=f'Score: {post.attrib["score"]} | Size: {post.attrib["width"]}x{post.attrib["height"]}')
    return embed
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号