emoji.py 文件源码

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

项目:pcbot 作者: pckv 项目源码 文件源码
def get_emote(emote_id: str, server: discord.Server):
    """ Return the image of a custom emote. """
    emote = discord.Emoji(id=emote_id, server=server)

    # Return the cached version if possible
    if emote.id in emote_cache:
        return Image.open(emote_cache[emote.id])

    # Otherwise, download the emote, store it in the cache and return
    emote_bytes = await utils.download_file(emote.url, bytesio=True)
    emote_cache[emote.id] = emote_bytes
    return Image.open(emote_bytes)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号